public abstract class Type extends Object
Modifier and Type | Field and Description |
---|---|
static BasicType |
BOOLEAN |
static BasicType |
BYTE |
static BasicType |
CHAR |
static ObjectType |
CLASS |
static BasicType |
DOUBLE |
static BasicType |
FLOAT |
static BasicType |
INT |
static BasicType |
LONG |
static Type[] |
NO_ARGS
Empty array.
|
static ReferenceType |
NULL |
static ObjectType |
OBJECT |
static BasicType |
SHORT |
protected String |
signature
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
static ObjectType |
STRING |
static ObjectType |
STRINGBUFFER |
static ObjectType |
THROWABLE |
protected byte |
type
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
static Type |
UNKNOWN |
static BasicType |
VOID
Predefined constants
|
Modifier | Constructor and Description |
---|---|
protected |
Type(byte type,
String signature) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static Type[] |
getArgumentTypes(String signature)
Convert arguments of a method (signature) to an array of Type objects.
|
String |
getClassName() |
static String |
getMethodSignature(Type returnType,
Type[] argTypes)
Convert type to Java method signature, e.g.
|
static Type |
getReturnType(String signature)
Convert return value of a method (signature) to a Type object.
|
String |
getSignature() |
static String |
getSignature(Method meth) |
int |
getSize() |
byte |
getType() |
static Type |
getType(Class<?> cls)
Convert runtime java.lang.Class to BCEL Type object.
|
static Type |
getType(String signature)
Convert signature to a Type object.
|
static Type[] |
getTypes(Class<?>[] classes)
Convert runtime java.lang.Class[] to BCEL Type objects.
|
int |
hashCode() |
Type |
normalizeForStackOrLocal()
boolean, short and char variable are considered as int in the stack or local variable area.
|
String |
toString() |
public static final BasicType VOID
public static final BasicType BOOLEAN
public static final BasicType INT
public static final BasicType SHORT
public static final BasicType BYTE
public static final BasicType LONG
public static final BasicType DOUBLE
public static final BasicType FLOAT
public static final BasicType CHAR
public static final ObjectType OBJECT
public static final ObjectType CLASS
public static final ObjectType STRING
public static final ObjectType STRINGBUFFER
public static final ObjectType THROWABLE
public static final Type[] NO_ARGS
public static final ReferenceType NULL
public static final Type UNKNOWN
@Deprecated protected byte type
@Deprecated protected String signature
protected Type(byte type, String signature)
public static Type[] getArgumentTypes(String signature)
signature
- signature string such as (Ljava/lang/String;)Vpublic static String getMethodSignature(Type returnType, Type[] argTypes)
returnType
- what the method returnsargTypes
- what are the argument typespublic static Type getReturnType(String signature)
signature
- signature string such as (Ljava/lang/String;)Vpublic static Type getType(Class<?> cls)
cls
- Java classpublic static Type getType(String signature) throws StringIndexOutOfBoundsException
signature
- signature string such as Ljava/lang/String;StringIndexOutOfBoundsException
public static Type[] getTypes(Class<?>[] classes)
classes
- an array of runtime class objectspublic boolean equals(Object o)
public String getClassName()
public String getSignature()
public int getSize()
public byte getType()
public Type normalizeForStackOrLocal()
INT
for BOOLEAN
, SHORT
or CHAR
, otherwise returns the given type.Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.