Package org.apache.bcel.generic
Class Type
java.lang.Object
org.apache.bcel.generic.Type
- Direct Known Subclasses:
BasicType
,DOUBLE_Upper
,LONG_Upper
,ReferenceType
,ReturnaddressType
Abstract super class for all possible Java types, namely basic types such as int, object types like String and array
types, e.g. int[]
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BasicType
static final BasicType
static final BasicType
static final ObjectType
static final BasicType
static final BasicType
static final BasicType
static final BasicType
static final Type[]
Empty array.static final ReferenceType
static final ObjectType
static final BasicType
protected String
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setterstatic final ObjectType
static final ObjectType
static final ObjectType
protected byte
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setterstatic final Type
static final BasicType
Predefined constants -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static Type[]
getArgumentTypes
(String signature) Convert arguments of a method (signature) to an array of Type objects.static String
getMethodSignature
(Type returnType, Type[] argTypes) Convert type to Java method signature, e.g.static Type
getReturnType
(String signature) Convert return value of a method (signature) to a Type object.static String
getSignature
(Method meth) int
getSize()
byte
getType()
static Type
Convert runtimeClass
to BCEL Type object.static Type
Convert signature to a Type object.static Type[]
Convert runtimejava.lang.Class[]
to BCEL Type objects.int
hashCode()
boolean, short and char variable are considered as int in the stack or local variable area.toString()
-
Field Details
-
VOID
Predefined constants -
BOOLEAN
-
INT
-
SHORT
-
BYTE
-
LONG
-
DOUBLE
-
FLOAT
-
CHAR
-
OBJECT
-
CLASS
-
STRING
-
STRINGBUFFER
-
THROWABLE
-
NO_ARGS
Empty array. -
NULL
-
UNKNOWN
-
type
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter -
signature
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
-
-
Constructor Details
-
Type
-
-
Method Details
-
getArgumentTypes
Convert arguments of a method (signature) to an array of Type objects.- Parameters:
signature
- signature string such as (Ljava/lang/String;)V- Returns:
- array of argument types
-
getMethodSignature
Convert type to Java method signature, e.g. int[] f(java.lang.String x) becomes (Ljava/lang/String;)[I- Parameters:
returnType
- what the method returnsargTypes
- what are the argument types- Returns:
- method signature for given type(s).
-
getReturnType
Convert return value of a method (signature) to a Type object.- Parameters:
signature
- signature string such as (Ljava/lang/String;)V- Returns:
- return type
-
getSignature
-
getType
Convert runtimeClass
to BCEL Type object.- Parameters:
cls
- Java class- Returns:
- corresponding Type object
-
getType
Convert signature to a Type object.- Parameters:
signature
- signature string such as Ljava/lang/String;- Returns:
- type object
- Throws:
StringIndexOutOfBoundsException
-
getTypes
Convert runtimejava.lang.Class[]
to BCEL Type objects.- Parameters:
classes
- an array of runtime class objects- Returns:
- array of corresponding Type objects
-
equals
-
getClassName
-
getSignature
- Returns:
- signature for given type.
-
getSize
- Returns:
- stack size of this type (2 for long and double, 0 for void, 1 otherwise)
-
getType
- Returns:
- type as defined in Constants
-
hashCode
-
normalizeForStackOrLocal
boolean, short and char variable are considered as int in the stack or local variable area. ReturnsINT
forBOOLEAN
,SHORT
orCHAR
, otherwise returns the given type.- Since:
- 6.0
-
toString
-