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

Variable Index

 o basic_type
 o consumed_chars
 o dimensions
 o name
 o type

Constructor Index

 o ClassGenType(byte)
Constructor for basic types such as int, long, `void'
 o ClassGenType(byte, int)
Constructor for array type, e.g.
 o ClassGenType(ClassGenType, int)
Constructor for array of given type
 o ClassGenType(String)
Constructor for reference type, e.g.
 o ClassGenType(String, int)
Constructor for reference array type, e.g.

Method Index

 o getArgumentTypes(String)
Convert arguments of a method (signature) to an array of ClassGenType objects.
 o getMethodSignature(ClassGenType, ClassGenType[])
Convert type to Java method signature, e.g.
 o getReturnType(String)
Convert arguments of a method (signature) to an array of ClassGenType objects.
 o getSignature()
 o getType(String)
 o toString()

Variables

 o type
 private byte type
 o name
 private String name
 o dimensions
 private int dimensions
 o basic_type
 private byte basic_type
 o consumed_chars
 private static int consumed_chars

Constructors

 o ClassGenType
 public ClassGenType(byte type)
Constructor for basic types such as int, long, `void'

Parameters:
type - one of T_INT, T_BOOLEAN, ..., T_VOID
 o ClassGenType
 public ClassGenType(String class_name)
Constructor for reference type, e.g. java.lang.String

Parameters:
class_name - String for complete class name
 o ClassGenType
 public ClassGenType(byte type,
                     int dimensions)
Constructor for array type, e.g. int[]

Parameters:
type - array type, e.g. T_INT
 o 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.)
 o ClassGenType
 public ClassGenType(ClassGenType type,
                     int dimensions)
Constructor for array of given type

Parameters:
type - type of array (may be an array itself)

Methods

 o getSignature
 public String getSignature()
Returns:
signature for given type.
 o toString
 public String toString()
Returns:
ClassGenType string, e.g. `int[]'
Overrides:
toString in class Object
 o 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).
 o getType
 private static final ClassGenType getType(String signature) throws StringIndexOutOfBoundsException
 o 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
 o 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