Package org.aspectj.apache.bcel.generic
Class Type
java.lang.Object
org.aspectj.apache.bcel.generic.Type
- Direct Known Subclasses:
BasicType
,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[]
- Version:
- $Id: Type.java,v 1.14 2011/09/28 01:14:54 aclement Exp $
- Author:
- M. Dahm modified: AndyClement 2-mar-05: Removed unnecessary static and optimized
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic BasicType
static BasicType
static BasicType
static ObjectType
static ArrayType
static BasicType
static ObjectType
static BasicType
static BasicType
static ObjectType
static ObjectType
static ObjectType
static BasicType
static Type[]
static ReferenceType
static ObjectType
static ArrayType
static BasicType
protected String
static ObjectType
static ArrayType
static Type[]
static Type[]
static Type[]
static Type[]
static Type[]
static Type[]
static Type[]
static ObjectType
static ObjectType
static ObjectType
protected byte
static Type
static BasicType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
getArgumentSizes(String signature)
Work out the type of each argument in the signature and return the cumulative sizes of all the types (size means number of stack slots it consumes, eg double=2, int=1).static Type[]
getArgumentTypes(String signature)
Convert arguments of a method (signature) to an array of Type objects.static Type
getReturnType(String signature)
Convert return value of a method (signature) to a Type object.static String
getSignature(Constructor<?> cons)
static String
getSignature(Method meth)
int
getSize()
byte
getType()
static Type
Convert runtime java.lang.Class to BCEL Type object.static Type
static Type.TypeHolder
getTypeInternal(String signature)
Convert signature to a Type object.static int
getTypeSize(String signature)
Return the size of the type expressed in the signature.toString()
-
Field Details
-
type
protected byte type -
signature
-
VOID
-
BOOLEAN
-
INT
-
SHORT
-
BYTE
-
LONG
-
DOUBLE
-
FLOAT
-
CHAR
-
OBJECT
-
STRING
-
OBJECT_ARRAY
-
STRING_ARRAY
-
CLASS_ARRAY
-
STRINGBUFFER
-
STRINGBUILDER
-
THROWABLE
-
CLASS
-
INTEGER
-
EXCEPTION
-
LIST
-
ITERATOR
-
NO_ARGS
-
NULL
-
UNKNOWN
-
STRINGARRAY1
-
STRINGARRAY2
-
STRINGARRAY3
-
STRINGARRAY4
-
STRINGARRAY5
-
STRINGARRAY6
-
STRINGARRAY7
-
-
Constructor Details
-
Type
-
-
Method Details
-
getSignature
-
getType
public byte getType() -
getSize
public int getSize()- Returns:
- stack size of this type (2 for long and double, 0 for void, 1 otherwise)
-
toString
-
getType
-
getTypeInternal
public static final Type.TypeHolder getTypeInternal(String signature) throws StringIndexOutOfBoundsExceptionConvert signature to a Type object.- Parameters:
signature
- signature string such as Ljava/lang/String;- Returns:
- type object
- Throws:
StringIndexOutOfBoundsException
-
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
-
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
-
getArgumentSizes
Work out the type of each argument in the signature and return the cumulative sizes of all the types (size means number of stack slots it consumes, eg double=2, int=1). Unlike the call above, this does minimal unpacking -
getTypeSize
Return the size of the type expressed in the signature. The signature should contain only one type. -
getType
Convert runtime java.lang.Class to BCEL Type object.- Parameters:
cl
- Java class- Returns:
- corresponding Type object
-
getSignature
-
getSignature
-