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 393344 2006-04-12 00:38:34Z tcurdt $
boolean | equals(Object o)
|
static Type[] | getArgumentTypes(String signature) - Convert arguments of a method (signature) to an array of Type objects.
|
static String | getMethodSignature(Type return_type, Type[] arg_types) - Convert type to Java method signature, e.g.
|
static Type | getReturnType(String signature) - Convert return value of a method (signature) to a Type object.
|
String | getSignature()
|
static String | getSignature(java.lang.reflect.Method meth)
|
int | getSize()
|
byte | getType()
|
static Type | getType(String signature) - Convert signature to a Type object.
|
static Type | getType(java.lang.Class cl) - Convert runtime java.lang.Class to BCEL Type object.
|
static Type[] | getTypes(java.lang.Class[] classes) - Convert runtime java.lang.Class[] to BCEL Type objects.
|
int | hashCode()
|
String | toString()
|
private static int | unwrap(ThreadLocal tl)
|
private static void | wrap(ThreadLocal tl, int value)
|
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
consumed_chars
private static ThreadLocal consumed_chars
signature
protected String signature
Type
protected Type(byte t,
String s)
equals
public boolean equals(Object o)
- whether the Types are equal
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
getTypes
public static Type[] getTypes(java.lang.Class[] classes)
Convert runtime java.lang.Class[] to BCEL Type objects.
classes
- an array of runtime class objects
- array of corresponding Type objects
hashCode
public int hashCode()
toString
public String toString()
- Type string, e.g. `int[]'
unwrap
private static int unwrap(ThreadLocal tl)
wrap
private static void wrap(ThreadLocal tl,
int value)