All Packages Class Hierarchy This Package Previous Next Index
Class espresso.classfile.classgen.ClassGenType
java.lang.Object
|
+----espresso.classfile.classgen.ClassGenType
- public final class ClassGenType
- extends Object
- implements Constants
Represents a basic or reference type (int, short, ..., objectref, arrayref)
- See Also:
- Instruction
-
basic_type
-
-
consumed_chars
-
-
dimensions
-
-
name
-
-
type
-
-
ClassGenType(byte)
- Constructor for basic types such as int, long, `void'
-
ClassGenType(byte, int)
- Constructor for array type, e.g.
-
ClassGenType(ClassGenType, int)
- Constructor for array of given type
-
ClassGenType(String)
- Constructor for reference type, e.g.
-
ClassGenType(String, int)
- Constructor for reference array type, e.g.
-
getArgumentTypes(String)
- Convert arguments of a method (signature) to an array of ClassGenType objects.
-
getMethodSignature(ClassGenType, ClassGenType[])
- Convert type to Java method signature, e.g.
-
getReturnType(String)
- Convert arguments of a method (signature) to an array of ClassGenType objects.
-
getSignature()
-
-
getType(String)
-
-
toString()
-
type
private byte type
name
private String name
dimensions
private int dimensions
basic_type
private byte basic_type
consumed_chars
private static int consumed_chars
ClassGenType
public ClassGenType(byte type)
- Constructor for basic types such as int, long, `void'
- Parameters:
- type - one of T_INT, T_BOOLEAN, ..., T_VOID
ClassGenType
public ClassGenType(String class_name)
- Constructor for reference type, e.g. java.lang.String
- Parameters:
- class_name - String for complete class name
ClassGenType
public ClassGenType(byte type,
int dimensions)
- Constructor for array type, e.g. int[]
- Parameters:
- type - array type, e.g. T_INT
ClassGenType
public ClassGenType(String class_name,
int dimensions)
- Constructor for reference array type, e.g. Object[]
- Parameters:
- class_name - complete name of class (java.lang.String, e.g.)
ClassGenType
public ClassGenType(ClassGenType type,
int dimensions)
- Constructor for array of given type
- Parameters:
- type - type of array (may be an array itself)
getSignature
public String getSignature()
- Returns:
- signature for given type.
toString
public String toString()
- Returns:
- ClassGenType string, e.g. `int[]'
- Overrides:
- toString in class Object
getMethodSignature
public static String getMethodSignature(ClassGenType return_type,
ClassGenType arg_types[])
- Convert type to Java method signature, e.g. int[] f(java.lang.String x)
becomes (Ljava/lang/String;)[I
- Parameters:
- return_type - what the method returns
- arg_types - what are the argument types
- Returns:
- method signature for given type(s).
getType
private static final ClassGenType getType(String signature) throws StringIndexOutOfBoundsException
getReturnType
public static ClassGenType getReturnType(String signature)
- Convert arguments of a method (signature) to an array of ClassGenType objects.
- Parameters:
- signature - signature string such as (Ljava/lang/String;)V
- Returns:
- return type
getArgumentTypes
public static ClassGenType[] getArgumentTypes(String signature)
- Convert arguments of a method (signature) to an array of ClassGenType objects.
- Parameters:
- signature - signature string such as (Ljava/lang/String;)V
- Returns:
- array of argument types
All Packages Class Hierarchy This Package Previous Next Index