public abstract class Type extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static BasicType |
BOOLEAN |
static BasicType |
BYTE |
static BasicType |
CHAR |
static ObjectType |
CLASS |
static BasicType |
DOUBLE |
static BasicType |
FLOAT |
static BasicType |
INT |
static BasicType |
LONG |
static Type[] |
NO_ARGS |
static ReferenceType |
NULL |
static ObjectType |
OBJECT |
static BasicType |
SHORT |
protected String |
signature |
static ObjectType |
STRING |
static ObjectType |
STRINGBUFFER |
static ObjectType |
THROWABLE |
protected byte |
type |
static Type |
UNKNOWN |
static BasicType |
VOID
Predefined constants
|
Modifier | Constructor and Description |
---|---|
protected |
Type(byte t,
String s) |
Modifier and Type | Method and Description |
---|---|
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(Method meth) |
int |
getSize() |
byte |
getType() |
static Type |
getType(Class<?> cl)
Convert runtime java.lang.Class to BCEL Type object.
|
static Type |
getType(String signature)
Convert signature to a Type object.
|
static Type[] |
getTypes(Class<?>[] classes)
Convert runtime java.lang.Class[] to BCEL Type objects.
|
int |
hashCode() |
String |
toString() |
protected byte type
protected String signature
public static final BasicType VOID
public static final BasicType BOOLEAN
public static final BasicType INT
public static final BasicType SHORT
public static final BasicType BYTE
public static final BasicType LONG
public static final BasicType DOUBLE
public static final BasicType FLOAT
public static final BasicType CHAR
public static final ObjectType OBJECT
public static final ObjectType CLASS
public static final ObjectType STRING
public static final ObjectType STRINGBUFFER
public static final ObjectType THROWABLE
public static final Type[] NO_ARGS
public static final ReferenceType NULL
public static final Type UNKNOWN
protected Type(byte t, String s)
public boolean equals(Object o)
public String getSignature()
public byte getType()
public int getSize()
public String toString()
public static String getMethodSignature(Type return_type, Type[] arg_types)
return_type
- what the method returnsarg_types
- what are the argument typespublic static Type getType(String signature) throws StringIndexOutOfBoundsException
signature
- signature string such as Ljava/lang/String;StringIndexOutOfBoundsException
public static Type getReturnType(String signature)
signature
- signature string such as (Ljava/lang/String;)Vpublic static Type[] getArgumentTypes(String signature)
signature
- signature string such as (Ljava/lang/String;)Vpublic static Type getType(Class<?> cl)
cl
- Java classpublic static Type[] getTypes(Class<?>[] classes)
classes
- an array of runtime class objects