Class Type
java.lang.Object
org.apache.bcel.generic.Type
- All Implemented Interfaces:
Serializable
- 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[]
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BasicTypestatic final BasicTypestatic final BasicTypestatic final ObjectTypestatic final BasicTypestatic final BasicTypestatic final BasicTypestatic final BasicTypestatic final Type[]static final ReferenceTypestatic final ObjectTypestatic final BasicTypeprotected Stringstatic final ObjectTypestatic final ObjectTypestatic final ObjectTypeprotected final bytestatic final Typestatic 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.static StringgetMethodSignature(Type return_type, Type[] arg_types) Convert type to Java method signature, e.g.static TypegetReturnType(String signature) Convert return value of a method (signature) to a Type object.static StringgetSignature(Method meth) intgetSize()bytegetType()static TypeConvert runtime java.lang.Class to BCEL Type object.static final TypeConvert signature to a Type object.static Type[]Convert runtime java.lang.Class[] to BCEL Type objects.inthashCode()toString()
-
Field Details
-
type
protected final byte type -
signature
-
VOID
Predefined constants -
BOOLEAN
-
INT
-
SHORT
-
BYTE
-
LONG
-
DOUBLE
-
FLOAT
-
CHAR
-
OBJECT
-
CLASS
-
STRING
-
STRINGBUFFER
-
THROWABLE
-
NO_ARGS
-
NULL
-
UNKNOWN
-
-
Constructor Details
-
Type
-
-
Method Details
-
hashCode
-
equals
-
getSignature
- Returns:
- signature for given type.
-
getType
public byte getType()- Returns:
- type as defined in Constants
-
getSize
public int getSize()- Returns:
- stack size of this type (2 for long and double, 0 for void, 1 otherwise)
-
toString
-
getMethodSignature
Convert type to Java method signature, e.g. int[] f(java.lang.String x) becomes (Ljava/lang/String;)[I- Parameters:
return_type- what the method returnsarg_types- what are the argument types- Returns:
- method signature for given type(s).
-
getType
Convert signature to a Type object.- Parameters:
signature- signature string such as Ljava/lang/String;- Returns:
- type object
- Throws:
StringIndexOutOfBoundsException
-
getReturnType
-
getArgumentTypes
-
getType
-
getTypes
-
getSignature
-