Class Type
java.lang.Object
org.apache.bcel.generic.Type
- Direct Known Subclasses:
BasicType, DOUBLE_Upper, LONG_Upper, ReferenceType, ReturnaddressType
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BasicTypePredefined constant for boolean type.static final BasicTypePredefined constant for byte type.static final BasicTypePredefined constant for char type.static final ObjectTypePredefined constant for Class type.static final BasicTypePredefined constant for double type.static final BasicTypePredefined constant for float type.static final BasicTypePredefined constant for int type.static final BasicTypePredefined constant for long type.static final Type[]Empty array.static final ReferenceTypePredefined constant for null type.static final ObjectTypePredefined constant for Object type.static final BasicTypePredefined constant for short type.protected StringDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterstatic final ObjectTypePredefined constant for String type.static final ObjectTypePredefined constant for StringBuffer type.static final ObjectTypePredefined constant for Throwable type.protected byteDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterstatic final TypePredefined constant for unknown type.static final BasicTypePredefined constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic Type[]getArgumentTypes(String signature) Convert arguments of a method (signature) to an array of Type objects.Gets the class name.static StringgetMethodSignature(Type returnType, Type[] argTypes) Convert type to Java method signature, for example int[] f(java.lang.String x) becomes (Ljava/lang/String;)[Istatic TypegetReturnType(String signature) Convert return value of a method (signature) to a Type object.Gets the signature for this type.static StringgetSignature(Method meth) Gets the signature for a method.intgetSize()Gets the stack size of this type.bytegetType()Gets the type as defined in Constants.static TypeConvert runtimeClassto BCEL Type object.static TypeConvert signature to a Type object.static Type[]Convert runtimejava.lang.Class[]to BCEL Type objects.inthashCode()Gets the hash code of this Type.boolean, short and char variable are considered as int in the stack or local variable area.toString()
-
Field Details
-
VOID
-
BOOLEAN
-
INT
-
SHORT
-
BYTE
-
LONG
-
DOUBLE
-
FLOAT
-
CHAR
-
OBJECT
Predefined constant for Object type. -
CLASS
Predefined constant for Class type. -
STRING
Predefined constant for String type. -
STRINGBUFFER
Predefined constant for StringBuffer type. -
THROWABLE
Predefined constant for Throwable type. -
NO_ARGS
-
NULL
Predefined constant for null type. -
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, for example int[] f(java.lang.String x) becomes (Ljava/lang/String;)[I- Parameters:
returnType- what the method returns.argTypes- 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
Gets the signature for a method.- Parameters:
meth- The method.- Returns:
- The method signature.
-
getType
-
getType
Convert signature to a Type object.- Parameters:
signature- signature string such as Ljava/lang/String;.- Returns:
- type object.
- Throws:
StringIndexOutOfBoundsException
-
getTypes
-
equals
-
getClassName
-
getSignature
-
getSize
Gets the stack size of this type.- Returns:
- stack size of this type (2 for long and double, 0 for void, 1 otherwise).
-
getType
-
hashCode
-
normalizeForStackOrLocal
-
toString
-