Top Description Inners Fields Constructors Methods
org.aspectj.apache.bcel.generic

public abstract Class Type

extends Object
Class Inheritance
Known Direct Subclasses
org.aspectj.apache.bcel.generic.BasicType, org.aspectj.apache.bcel.generic.ReferenceType, org.aspectj.apache.bcel.generic.ReturnaddressType
Imports
java.util.ArrayList, .HashMap, .List, .Map, org.aspectj.apache.bcel.Constants, .ConstantsInitializer, org.aspectj.apache.bcel.classfile.ClassFormatException, .Utility

Abstract super class for all possible java types, namely basic types such as int, object types like String and array types, e.g. int[]
Author
M. Dahm modified: AndyClement 2-mar-05: Removed unnecessary static and optimized
Version
$Id: Type.java,v 1.14 2011/09/28 01:14:54 aclement Exp $

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final BasicType
public static final BasicType
public static final BasicType
public static final ObjectType
public static final ArrayType
private static Map<String, Type>
public static final BasicType
public static final ObjectType
public static final BasicType
public static final BasicType
public static final ObjectType
public static final ObjectType
public static final ObjectType
public static final BasicType
public static final Type[]
public static final ReferenceType
public static final ObjectType
public static final ArrayType
public static final BasicType
protected String
public static final ObjectType
public static final ArrayType
public static final Type[]
public static final Type[]
public static final Type[]
public static final Type[]
public static final Type[]
public static final Type[]
public static final Type[]
public static final ObjectType
public static final ObjectType
public static final ObjectType
protected byte
public static final Type
public static final BasicType

Constructor Summary

AccessConstructor and Description
protected
Type(byte t, String s)

Method Summary

Modifier and TypeMethod and Description
public static 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).

public static Type[]

Returns:

array of argument types
getArgumentTypes
(String
signature string such as (Ljava/lang/String;)V
signature
)

Convert arguments of a method (signature) to an array of Type objects.

public static Type

Returns:

return type
getReturnType
(String
signature string such as (Ljava/lang/String;)V
signature
)

Convert return value of a method (signature) to a Type object.

public String
public static String
public static String
public int

Returns:

stack size of this type (2 for long and double, 0 for void, 1 otherwise)
getSize
()

public byte
public static final Type
getType(String signature)

public static Type

Returns:

corresponding Type object
getType
(Class<T>
Java class
cl
)

Convert runtime java.lang.Class to BCEL Type object.

public static final Type.TypeHolder

Returns:

type object
getTypeInternal
(String
signature string such as Ljava/lang/String;
signature
)

Convert signature to a Type object.

public static int
getTypeSize(String signature)

Return the size of the type expressed in the signature.

public String

Returns:

Type string, e.g. 'int[]'
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

BOOLEANback to summary
public static final BasicType BOOLEAN
BYTEback to summary
public static final BasicType BYTE
CHARback to summary
public static final BasicType CHAR
CLASSback to summary
public static final ObjectType CLASS
CLASS_ARRAYback to summary
public static final ArrayType CLASS_ARRAY
commonTypesback to summary
private static Map<String, Type> commonTypes
DOUBLEback to summary
public static final BasicType DOUBLE
EXCEPTIONback to summary
public static final ObjectType EXCEPTION
FLOATback to summary
public static final BasicType FLOAT
INTback to summary
public static final BasicType INT
INTEGERback to summary
public static final ObjectType INTEGER
ITERATORback to summary
public static final ObjectType ITERATOR
LISTback to summary
public static final ObjectType LIST
LONGback to summary
public static final BasicType LONG
NO_ARGSback to summary
public static final Type[] NO_ARGS
NULLback to summary
public static final ReferenceType NULL
OBJECTback to summary
public static final ObjectType OBJECT
OBJECT_ARRAYback to summary
public static final ArrayType OBJECT_ARRAY
SHORTback to summary
public static final BasicType SHORT
signatureback to summary
protected String signature
STRINGback to summary
public static final ObjectType STRING
STRING_ARRAYback to summary
public static final ArrayType STRING_ARRAY
STRINGARRAY1back to summary
public static final Type[] STRINGARRAY1
STRINGARRAY2back to summary
public static final Type[] STRINGARRAY2
STRINGARRAY3back to summary
public static final Type[] STRINGARRAY3
STRINGARRAY4back to summary
public static final Type[] STRINGARRAY4
STRINGARRAY5back to summary
public static final Type[] STRINGARRAY5
STRINGARRAY6back to summary
public static final Type[] STRINGARRAY6
STRINGARRAY7back to summary
public static final Type[] STRINGARRAY7
STRINGBUFFERback to summary
public static final ObjectType STRINGBUFFER
STRINGBUILDERback to summary
public static final ObjectType STRINGBUILDER
THROWABLEback to summary
public static final ObjectType THROWABLE
typeback to summary
protected byte type
UNKNOWNback to summary
public static final Type UNKNOWN
VOIDback to summary
public static final BasicType VOID

Constructor Detail

Typeback to summary
protected Type(byte t, String s)

Method Detail

getArgumentSizesback to summary
public static 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). Unlike the call above, this does minimal unpacking

getArgumentTypesback to summary
public static Type[] getArgumentTypes(String signature)

Convert arguments of a method (signature) to an array of Type objects.

Parameters
signature:String

signature string such as (Ljava/lang/String;)V

Returns:Type[]

array of argument types

getReturnTypeback to summary
public static Type getReturnType(String signature)

Convert return value of a method (signature) to a Type object.

Parameters
signature:String

signature string such as (Ljava/lang/String;)V

Returns:Type

return type

getSignatureback to summary
public String getSignature()
getSignatureback to summary
public static String getSignature(Method meth)
getSignatureback to summary
public static String getSignature(Constructor<?> cons)
getSizeback to summary
public int getSize()
Returns:int

stack size of this type (2 for long and double, 0 for void, 1 otherwise)

getTypeback to summary
public byte getType()
getTypeback to summary
public static final Type getType(String signature)
getTypeback to summary
public static Type getType(Class<T> cl)

Convert runtime java.lang.Class to BCEL Type object.

Parameters
cl:Class<T>

Java class

Returns:Type

corresponding Type object

getTypeInternalback to summary
public static final Type.TypeHolder getTypeInternal(String signature) throws StringIndexOutOfBoundsException

Convert signature to a Type object.

Parameters
signature:String

signature string such as Ljava/lang/String;

Returns:Type.TypeHolder

type object

getTypeSizeback to summary
public static int getTypeSize(String signature)

Return the size of the type expressed in the signature. The signature should contain only one type.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

Type string, e.g. 'int[]'

Annotations
@Override
org.aspectj.apache.bcel.generic back to summary

public Class Type.TypeHolder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int
private Type
t

Constructor Summary

AccessConstructor and Description
public
TypeHolder(Type t, int i)

Method Summary

Modifier and TypeMethod and Description
public int
public Type
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

consumedback to summary
private int consumed
tback to summary
private Type t

Constructor Detail

TypeHolderback to summary
public TypeHolder(Type t, int i)

Method Detail

getConsumedback to summary
public int getConsumed()
getTypeback to summary
public Type getType()