Class ArrayType
java.lang.Object
org.apache.bcel.generic.Type
org.apache.bcel.generic.ReferenceType
org.apache.bcel.generic.ArrayType
Denotes array type, such as int[][]
-
Field Summary
Fields inherited from class Type
BOOLEAN, BYTE, CHAR, CLASS, DOUBLE, FLOAT, INT, LONG, NO_ARGS, NULL, OBJECT, SHORT, signature, STRING, STRINGBUFFER, THROWABLE, type, UNKNOWN, VOIDModifier and TypeFieldDescriptionstatic final BasicTypePredefined constant for boolean type.static final BasicTypePredefined constant for byte type.static final BasicTypePredefined constant for char type.static final ObjectTypePredefined constant for Class type.static final BasicTypePredefined constant for double type.static final BasicTypePredefined constant for float type.static final BasicTypePredefined constant for int type.static final BasicTypePredefined constant for long type.static final Type[]Empty array.static final ReferenceTypePredefined constant for null type.static final ObjectTypePredefined constant for Object type.static final BasicTypePredefined constant for short type.protected StringDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterstatic final ObjectTypePredefined constant for String type.static final ObjectTypePredefined constant for StringBuffer type.static final ObjectTypePredefined constant for Throwable type.protected byteDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterstatic final TypePredefined constant for unknown type.static final BasicTypePredefined constants -
Constructor Summary
ConstructorsConstructorDescriptionArrayType(byte type, int dimensions) Convenience constructor for array type, for example int[]Convenience constructor for reference array type, for example Object[]Constructor for array of given type -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the basic type of array, that is, forint[][][]the basic type is int.Gets the name of referenced class.intGets the number of dimensions of array.Gets the element type of array, that is, forint[][][]the element type isint[][].inthashCode()Gets the hash code of this Type.booleanisElementType(Type type) Tests whether the given type is the element type of this array type, that is, forint[][][]the element type isint[][].Methods inherited from class ReferenceType
firstCommonSuperclass, getFirstCommonSuperclass, isAssignmentCompatibleWith, isCastableToModifier and TypeMethodDescriptionDeprecated.Use getFirstCommonSuperclass(ReferenceType t) which has slightly changed semantics.Gets the first common superclass (narrowest ReferenceType referencing a class, not an interface).booleanTests whether this type is assignment compatible with another type t as defined in the JVM specification; see the AASTORE definition there.booleanisCastableTo(Type t) Tests whether this type is castable to another type t as defined in the JVM specification.Methods inherited from class Type
getArgumentTypes, getMethodSignature, getReturnType, getSignature, getSignature, getSize, getType, getType, getType, getTypes, normalizeForStackOrLocal, toStringModifier and TypeMethodDescriptionstatic Type[]getArgumentTypes(String signature) Gets the argument types of a method from its signature as an array of Type objects.static StringgetMethodSignature(Type returnType, Type[] argTypes) Gets the Java method signature for the given types, for example, int[] f(java.lang.String x) becomes (Ljava/lang/String;)[I.static TypegetReturnType(String signature) Gets the return type of a method from its signature as a Type object.Gets the signature for this type.static StringgetSignature(Method meth) Gets the signature for a method.intgetSize()Gets the stack size of this type.bytegetType()Gets the type as defined in Constants.static TypeGets the BCEL Type object corresponding to a runtimeClass.static TypeGets the Type object corresponding to a signature.static Type[]Gets the BCEL Type objects corresponding to an array of runtime classes.boolean, short and char variable are considered as int in the stack or local variable area.toString()
-
Constructor Details
-
ArrayType
Convenience constructor for array type, for example int[]- Parameters:
type- array type, for example T_INT.dimensions- array dimensions.
-
ArrayType
-
ArrayType
-
-
Method Details
-
equals
-
getBasicType
Gets the basic type of array, that is, forint[][][]the basic type is int.- Returns:
- basic type of array, that is, for
int[][][]the basic type is int.
-
getClassName
Gets the name of referenced class.- Overrides:
getClassNamein classType- Returns:
- name of referenced class.
- Since:
- 6.7.0
-
getDimensions
Gets the number of dimensions of array.- Returns:
- number of dimensions of array.
-
getElementType
Gets the element type of array, that is, forint[][][]the element type isint[][].- Returns:
- element type of array, that is, for
int[][][]the element type isint[][].
-
hashCode
-
isElementType
Tests whether the given type is the element type of this array type, that is, forint[][][]the element type isint[][].- Parameters:
type- the type to test.- Returns:
- true if the given type is the element type of this array type, that is, for
int[][][]the element type isint[][]. - Since:
- 6.13.0
-