Class ReferenceType
java.lang.Object
org.aspectj.apache.bcel.generic.Type
org.aspectj.apache.bcel.generic.ReferenceType
- Direct Known Subclasses:
ArrayType, ObjectType
-
Nested Class Summary
Nested classes/interfaces inherited from class Type
Type.TypeHolder -
Field Summary
Fields inherited from class Type
BOOLEAN, BYTE, CHAR, CLASS, CLASS_ARRAY, DOUBLE, EXCEPTION, FLOAT, INT, INTEGER, ITERATOR, LIST, LONG, NO_ARGS, NULL, OBJECT, OBJECT_ARRAY, SHORT, signature, STRING, STRING_ARRAY, STRINGARRAY1, STRINGARRAY2, STRINGARRAY3, STRINGARRAY4, STRINGARRAY5, STRINGARRAY6, STRINGARRAY7, STRINGBUFFER, STRINGBUILDER, THROWABLE, type, UNKNOWN, VOIDModifier 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 TypeMethodDescriptionThis commutative operation returns the first common superclass (narrowest ReferenceType referencing a class, not an interface).booleanReturn true iff this is assignment compatible with another type t as defined in the JVM specification; see the AASTORE definition there.booleanisCastableTo(Type t) Return true iff this type is castable to another type t as defined in the JVM specification.Methods inherited from class Type
getArgumentSizes, getArgumentTypes, getReturnType, getSignature, getSignature, getSignature, getSize, getType, getType, getType, getTypeInternal, getTypeSize, toStringModifier 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()
-
Constructor Details
-
ReferenceType
-
-
Method Details
-
isCastableTo
Return true iff this type is castable to another type t as defined in the JVM specification. The case where this is Type.NULL is not defined (see the CHECKCAST definition in the JVM specification). However, because e.g. CHECKCAST doesn't throw a ClassCastException when casting a null reference to any Object, true is returned in this case. -
isAssignmentCompatibleWith
Return true iff this is assignment compatible with another type t as defined in the JVM specification; see the AASTORE definition there. -
getFirstCommonSuperclass
This commutative operation returns the first common superclass (narrowest ReferenceType referencing a class, not an interface). If one of the types is a superclass of the other, the former is returned. If "this" is Type.NULL, then t is returned. If t is Type.NULL, then "this" is returned. If "this" equals t ['this.equals(t)'] "this" is returned. If "this" or t is an ArrayType, then Type.OBJECT is returned; unless their dimensions match. Then an ArrayType of the same number of dimensions is returned, with its basic type being the first common super class of the basic types of "this" and t. If "this" or t is a ReferenceType referencing an interface, then Type.OBJECT is returned. If not all of the two classes' superclasses cannot be found, "null" is returned. See the JVM specification edition 2, "4.9.2 The Bytecode Verifier".
-