Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.techtrader.modules.tools.bytecode
Class BCHelper  view BCHelper download BCHelper.java

java.lang.Object
  extended bycom.techtrader.modules.tools.bytecode.BCHelper

class BCHelper
extends java.lang.Object

Utility methods for dealing with the internal form of type names.


Field Summary
private static java.lang.Object[][] _codes
           
private static java.util.Map _wrappers
           
 
Constructor Summary
(package private) BCHelper()
           
 
Method Summary
static java.lang.Class classForName(java.lang.String name)
          Return the Class object for the given class name in intenal form.
static java.lang.String getDescriptor(java.lang.String returnType, java.lang.String[] paramTypes)
          Constructs a method descriptor from the given return and parameter types, which should be in internal form.
static java.lang.String getExternalForm(java.lang.String internalName, boolean humanReadable)
          Given the internal name of the class, return the 'normal' java name.
static java.lang.String getInternalForm(java.lang.String className, boolean descriptor)
          Converts the given class name to its internal form.
static java.lang.String[] getParamTypes(java.lang.String descriptor)
          Get the parameter types, in internal form, for the given method descriptor string.
static java.lang.String getReturnType(java.lang.String descriptor)
          Get the return type, in internal form, for the given method descriptor string.
static java.lang.Class getWrapperClass(java.lang.String name)
          Return the wrapper type for the given primitive class, or null if the given name is not a primitive type.
static boolean hasFlag(int value, int flag)
          Return true if the given value contains the given flag.
static int setFlag(int value, int flag, boolean on)
          Returns the given value after setting the given flag to 'on' or 'off', as specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_codes

private static final java.lang.Object[][] _codes

_wrappers

private static final java.util.Map _wrappers
Constructor Detail

BCHelper

BCHelper()
Method Detail

getWrapperClass

public static java.lang.Class getWrapperClass(java.lang.String name)
Return the wrapper type for the given primitive class, or null if the given name is not a primitive type. The given name should be in external form.


classForName

public static java.lang.Class classForName(java.lang.String name)
                                    throws java.lang.ClassNotFoundException
Return the Class object for the given class name in intenal form.


getInternalForm

public static java.lang.String getInternalForm(java.lang.String className,
                                               boolean descriptor)
Converts the given class name to its internal form.


getExternalForm

public static java.lang.String getExternalForm(java.lang.String internalName,
                                               boolean humanReadable)
Given the internal name of the class, return the 'normal' java name.


hasFlag

public static boolean hasFlag(int value,
                              int flag)
Return true if the given value contains the given flag.


setFlag

public static int setFlag(int value,
                          int flag,
                          boolean on)
Returns the given value after setting the given flag to 'on' or 'off', as specified.


getReturnType

public static java.lang.String getReturnType(java.lang.String descriptor)
Get the return type, in internal form, for the given method descriptor string.


getParamTypes

public static java.lang.String[] getParamTypes(java.lang.String descriptor)
Get the parameter types, in internal form, for the given method descriptor string.


getDescriptor

public static java.lang.String getDescriptor(java.lang.String returnType,
                                             java.lang.String[] paramTypes)
Constructs a method descriptor from the given return and parameter types, which should be in internal form.