| java.lang.Object com.tc.asm.Type
Type | public class Type (Code) | | A Java type. This class can be used to make it easier to manipulate type and
method descriptors.
author: Eric Bruneton author: Chris Nokleberg |
Field Summary | |
final public static int | ARRAY The sort of array reference types. | final public static int | BOOLEAN The sort of the boolean type. | final public static Type | BOOLEAN_TYPE The boolean type. | final public static int | BYTE The sort of the byte type. | final public static Type | BYTE_TYPE The byte type. | final public static int | CHAR The sort of the char type. | final public static Type | CHAR_TYPE The char type. | final public static int | DOUBLE The sort of the double type. | final public static Type | DOUBLE_TYPE The double type. | final public static int | FLOAT The sort of the float type. | final public static Type | FLOAT_TYPE The float type. | final public static int | INT The sort of the int type. | final public static Type | INT_TYPE The int type. | final public static int | LONG The sort of the long type. | final public static Type | LONG_TYPE The long type. | final public static int | OBJECT The sort of object reference type. | final public static int | SHORT The sort of the short type. | final public static Type | SHORT_TYPE The short type. | final public static int | VOID The sort of the void type. | final public static Type | VOID_TYPE The void type. |
Method Summary | |
public boolean | equals(Object o) Tests if the given object is equal to this type.
Parameters: o - the object to be compared to this type. | public static Type[] | getArgumentTypes(String methodDescriptor) Returns the Java types corresponding to the argument types of the given
method descriptor.
Parameters: methodDescriptor - a method descriptor. | public static Type[] | getArgumentTypes(Method method) Returns the Java types corresponding to the argument types of the given
method.
Parameters: method - a method. | public String | getClassName() Returns the name of the class corresponding to this type. | public static String | getConstructorDescriptor(Constructor c) Returns the descriptor corresponding to the given constructor.
Parameters: c - a Constructor Constructor object. | public String | getDescriptor() Returns the descriptor corresponding to this Java type. | public static String | getDescriptor(Class c) Returns the descriptor corresponding to the given Java type.
Parameters: c - an object class, a primitive class or an array class. | public int | getDimensions() Returns the number of dimensions of this array type. | public Type | getElementType() Returns the type of the elements of this array type. | public String | getInternalName() Returns the internal name of the class corresponding to this object type.
The internal name of a class is its fully qualified name, where '.' are
replaced by '/'. | public static String | getInternalName(Class c) Returns the internal name of the given class. | public static String | getMethodDescriptor(Type returnType, Type[] argumentTypes) Returns the descriptor corresponding to the given argument and return
types.
Parameters: returnType - the return type of the method. Parameters: argumentTypes - the argument types of the method. | public static String | getMethodDescriptor(Method m) Returns the descriptor corresponding to the given method.
Parameters: m - a Method Method object. | public static Type | getObjectType(String name) Returns the
Type.OBJECT type for the given internal class name.
This is a shortcut method for Type.getType("L"+name+";") .
Note that opposed to
Type.getType(String) , this method takes
internal class names and not class descriptor.
Parameters: name - an internal class name. | public int | getOpcode(int opcode) Returns a JVM instruction opcode adapted to this Java type.
Parameters: opcode - a JVM instruction opcode. | public static Type | getReturnType(String methodDescriptor) Returns the Java type corresponding to the return type of the given
method descriptor.
Parameters: methodDescriptor - a method descriptor. | public static Type | getReturnType(Method method) Returns the Java type corresponding to the return type of the given
method.
Parameters: method - a method. | public int | getSize() Returns the size of values of this type. | public int | getSort() Returns the sort of this Java type. | public static Type | getType(String typeDescriptor) Returns the Java type corresponding to the given type descriptor.
Parameters: typeDescriptor - a type descriptor. | public static Type | getType(Class c) Returns the Java type corresponding to the given class.
Parameters: c - a class. | public int | hashCode() Returns a hash code value for this type. | public String | toString() Returns a string representation of this type. |
ARRAY | final public static int ARRAY(Code) | | The sort of array reference types. See
Type.getSort getSort .
|
BOOLEAN | final public static int BOOLEAN(Code) | | The sort of the boolean type. See
Type.getSort getSort .
|
BOOLEAN_TYPE | final public static Type BOOLEAN_TYPE(Code) | | The boolean type.
|
BYTE | final public static int BYTE(Code) | | The sort of the byte type. See
Type.getSort getSort .
|
BYTE_TYPE | final public static Type BYTE_TYPE(Code) | | The byte type.
|
CHAR | final public static int CHAR(Code) | | The sort of the char type. See
Type.getSort getSort .
|
CHAR_TYPE | final public static Type CHAR_TYPE(Code) | | The char type.
|
DOUBLE | final public static int DOUBLE(Code) | | The sort of the double type. See
Type.getSort getSort .
|
DOUBLE_TYPE | final public static Type DOUBLE_TYPE(Code) | | The double type.
|
FLOAT | final public static int FLOAT(Code) | | The sort of the float type. See
Type.getSort getSort .
|
FLOAT_TYPE | final public static Type FLOAT_TYPE(Code) | | The float type.
|
INT_TYPE | final public static Type INT_TYPE(Code) | | The int type.
|
LONG | final public static int LONG(Code) | | The sort of the long type. See
Type.getSort getSort .
|
LONG_TYPE | final public static Type LONG_TYPE(Code) | | The long type.
|
OBJECT | final public static int OBJECT(Code) | | The sort of object reference type. See
Type.getSort getSort .
|
SHORT | final public static int SHORT(Code) | | The sort of the short type. See
Type.getSort getSort .
|
SHORT_TYPE | final public static Type SHORT_TYPE(Code) | | The short type.
|
VOID | final public static int VOID(Code) | | The sort of the void type. See
Type.getSort getSort .
|
VOID_TYPE | final public static Type VOID_TYPE(Code) | | The void type.
|
equals | public boolean equals(Object o)(Code) | | Tests if the given object is equal to this type.
Parameters: o - the object to be compared to this type. true if the given object is equal to this type. |
getArgumentTypes | public static Type[] getArgumentTypes(String methodDescriptor)(Code) | | Returns the Java types corresponding to the argument types of the given
method descriptor.
Parameters: methodDescriptor - a method descriptor. the Java types corresponding to the argument types of the givenmethod descriptor. |
getArgumentTypes | public static Type[] getArgumentTypes(Method method)(Code) | | Returns the Java types corresponding to the argument types of the given
method.
Parameters: method - a method. the Java types corresponding to the argument types of the givenmethod. |
getClassName | public String getClassName()(Code) | | Returns the name of the class corresponding to this type.
the fully qualified name of the class corresponding to this type. |
getConstructorDescriptor | public static String getConstructorDescriptor(Constructor c)(Code) | | Returns the descriptor corresponding to the given constructor.
Parameters: c - a Constructor Constructor object. the descriptor of the given constructor. |
getDescriptor | public String getDescriptor()(Code) | | Returns the descriptor corresponding to this Java type.
the descriptor corresponding to this Java type. |
getDescriptor | public static String getDescriptor(Class c)(Code) | | Returns the descriptor corresponding to the given Java type.
Parameters: c - an object class, a primitive class or an array class. the descriptor corresponding to the given class. |
getDimensions | public int getDimensions()(Code) | | Returns the number of dimensions of this array type. This method should
only be used for an array type.
the number of dimensions of this array type. |
getElementType | public Type getElementType()(Code) | | Returns the type of the elements of this array type. This method should
only be used for an array type.
Returns the type of the elements of this array type. |
getInternalName | public String getInternalName()(Code) | | Returns the internal name of the class corresponding to this object type.
The internal name of a class is its fully qualified name, where '.' are
replaced by '/'. This method should only be used for an object type.
the internal name of the class corresponding to this object type. |
getInternalName | public static String getInternalName(Class c)(Code) | | Returns the internal name of the given class. The internal name of a
class is its fully qualified name, where '.' are replaced by '/'.
Parameters: c - an object class. the internal name of the given class. |
getMethodDescriptor | public static String getMethodDescriptor(Type returnType, Type[] argumentTypes)(Code) | | Returns the descriptor corresponding to the given argument and return
types.
Parameters: returnType - the return type of the method. Parameters: argumentTypes - the argument types of the method. the descriptor corresponding to the given argument and returntypes. |
getMethodDescriptor | public static String getMethodDescriptor(Method m)(Code) | | Returns the descriptor corresponding to the given method.
Parameters: m - a Method Method object. the descriptor of the given method. |
getObjectType | public static Type getObjectType(String name)(Code) | | Returns the
Type.OBJECT type for the given internal class name.
This is a shortcut method for Type.getType("L"+name+";") .
Note that opposed to
Type.getType(String) , this method takes
internal class names and not class descriptor.
Parameters: name - an internal class name. the the Type.OBJECT type for the given class name. |
getOpcode | public int getOpcode(int opcode)(Code) | | Returns a JVM instruction opcode adapted to this Java type.
Parameters: opcode - a JVM instruction opcode. This opcode must be one of ILOAD,ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL,ISHR, IUSHR, IAND, IOR, IXOR and IRETURN. an opcode that is similar to the given opcode, but adapted tothis Java type. For example, if this type is float andopcode is IRETURN, this method returns FRETURN. |
getReturnType | public static Type getReturnType(String methodDescriptor)(Code) | | Returns the Java type corresponding to the return type of the given
method descriptor.
Parameters: methodDescriptor - a method descriptor. the Java type corresponding to the return type of the givenmethod descriptor. |
getReturnType | public static Type getReturnType(Method method)(Code) | | Returns the Java type corresponding to the return type of the given
method.
Parameters: method - a method. the Java type corresponding to the return type of the givenmethod. |
getSize | public int getSize()(Code) | | Returns the size of values of this type.
the size of values of this type, i.e., 2 for long anddouble, and 1 otherwise. |
getType | public static Type getType(String typeDescriptor)(Code) | | Returns the Java type corresponding to the given type descriptor.
Parameters: typeDescriptor - a type descriptor. the Java type corresponding to the given type descriptor. |
getType | public static Type getType(Class c)(Code) | | Returns the Java type corresponding to the given class.
Parameters: c - a class. the Java type corresponding to the given class. |
hashCode | public int hashCode()(Code) | | Returns a hash code value for this type.
a hash code value for this type. |
toString | public String toString()(Code) | | Returns a string representation of this type.
the descriptor of this type. |
|
|