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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BasicTypestatic final BasicTypestatic final BasicTypestatic final ObjectTypestatic final ArrayTypestatic final BasicTypestatic final ObjectTypestatic final BasicTypestatic final BasicTypestatic final ObjectTypestatic final ObjectTypestatic final ObjectTypestatic final BasicTypestatic final Type[]static final ReferenceTypestatic final ObjectTypestatic final ArrayTypestatic final BasicTypeprotected Stringstatic final ObjectTypestatic final ArrayTypestatic final Type[]static final Type[]static final Type[]static final Type[]static final Type[]static final Type[]static final Type[]static final ObjectTypestatic final ObjectTypestatic final ObjectTypeprotected bytestatic final Typestatic final BasicType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetArgumentSizes(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 TypegetReturnType(String signature) Convert return value of a method (signature) to a Type object.static StringgetSignature(Constructor<?> cons) static StringgetSignature(Method meth) intgetSize()bytegetType()static TypeConvert runtime java.lang.Class to BCEL Type object.static final Typestatic final Type.TypeHoldergetTypeInternal(String signature) Convert signature to a Type object.static intgetTypeSize(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 StringIndexOutOfBoundsException Convert 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
-