org.apache.bcel.generic
Class Type
java.lang.Object
org.apache.bcel.generic.Type
- java.io.Serializable
public abstract class Type
extends java.lang.Object
implements java.io.Serializable
Abstract super class for all possible java types, namely basic types
such as int, object types like String and array types, e.g. int[]
$Id: Type.java,v 1.8 2002/08/07 18:01:32 mdahm Exp $
NO_ARGS
public static final Type[] NO_ARGS
STRINGBUFFER
public static final ObjectType STRINGBUFFER
UNKNOWN
public static final Type UNKNOWN
VOID
public static final BasicType VOID
Predefined constants
signature
protected String signature
Type
protected Type(byte t,
String s)
getArgumentTypes
public static Type[] getArgumentTypes(String signature)
Convert arguments of a method (signature) to an array of Type objects.
signature
- signature string such as (Ljava/lang/String;)V
getMethodSignature
public static String getMethodSignature(Type return_type,
Type[] arg_types)
Convert type to Java method signature, e.g. int[] f(java.lang.String x)
becomes (Ljava/lang/String;)[I
return_type
- what the method returnsarg_types
- what are the argument types
- method signature for given type(s).
getReturnType
public static Type getReturnType(String signature)
Convert return value of a method (signature) to a Type object.
signature
- signature string such as (Ljava/lang/String;)V
getSignature
public String getSignature()
- signature for given type.
getSignature
public static String getSignature(java.lang.reflect.Method meth)
getSize
public int getSize()
- stack size of this type (2 for long and double, 0 for void, 1 otherwise)
getType
public byte getType()
- type as defined in Constants
getType
public static final Type getType(String signature)
throws StringIndexOutOfBoundsException
Convert signature to a Type object.
signature
- signature string such as Ljava/lang/String;
getType
public static Type getType(java.lang.Class cl)
Convert runtime java.lang.Class to BCEL Type object.
- corresponding Type object
toString
public String toString()
- Type string, e.g. `int[]'