Class NdComplexTypeSignature
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.NdStruct
org.aspectj.org.eclipse.jdt.internal.core.nd.NdNode
org.aspectj.org.eclipse.jdt.internal.core.nd.java.NdTypeSignature
org.aspectj.org.eclipse.jdt.internal.core.nd.java.NdComplexTypeSignature
- All Implemented Interfaces:
IDestructable
,INdStruct
Represents a type signature that is anything other than a trivial reference to a concrete
type. If a type reference includes annotations, generic arguments, wildcards, or is a
type variable, this object represents it.
Arrays are encoded in a special way. The RAW_TYPE points to a sentinel type called '[' and the first type argument holds the array type.
-
Field Summary
Modifier and TypeFieldDescriptionstatic FieldOneToMany<NdComplexTypeSignature>
static FieldManyToOne<NdComplexTypeSignature>
static FieldManyToOne<NdTypeId>
static StructDef<NdComplexTypeSignature>
static FieldOneToMany<NdTypeArgument>
static FieldString
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.nd.java.NdTypeSignature
ANNOTATIONS_OF_THIS_TYPE, IMPLEMENTATIONS, SUBCLASSES, USED_AS_CONSTANT, USED_AS_ENUM_CONSTANT, USED_AS_EXCEPTION, USED_AS_METHOD_ARGUMENT, USED_AS_RETURN_TYPE, USED_AS_TYPE_ARGUMENT, USED_AS_TYPE_BOUND, VARIABLES_OF_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIf the receiver is an array type, it returns the signature of the array's next dimension.Returns the chain of declaring generic types.Returns the declaring type (as reported by the type's generic signature).Returns the raw version of this type, if one exists.void
getSignature(CharArrayBuffer result, boolean includeTrailingSemicolon)
Returns the type arguments for this type signature, if any.If this type is a type variable, this returns the variable's identifier.boolean
Returns true iff this is an array type signature (ie: that getArrayDimensionType() will return a non-null answer).boolean
void
setGenericDeclaringType(NdComplexTypeSignature enclosingType)
void
setRawType(NdTypeId rawType)
void
setVariableIdentifier(char[] variableIdentifier)
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.nd.java.NdTypeSignature
getImplementations, getSignature, getSubclasses, getSubTypes, toString
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.nd.NdNode
delete, destruct, equals, getAddress, getBindingID, getBit, getByte, getNodeId, getNodeType, hashCode, load, load
-
Field Details
-
VARIABLE_IDENTIFIER
-
RAW_TYPE
-
TYPE_ARGUMENTS
-
DECLARING_TYPE
-
DECLARED_TYPES
-
type
-
-
Constructor Details
-
NdComplexTypeSignature
-
NdComplexTypeSignature
-
-
Method Details
-
getRawType
Description copied from class:NdTypeSignature
Returns the raw version of this type, if one exists. That is, the version of this type without any generic arguments or annotations, which the java runtime sees. Returns null of this signature doesn't have a raw type, for example if it is a type variable.- Specified by:
getRawType
in classNdTypeSignature
-
setVariableIdentifier
public void setVariableIdentifier(char[] variableIdentifier) -
getVariableIdentifier
If this type is a type variable, this returns the variable's identifier. -
setRawType
-
setGenericDeclaringType
-
getGenericDeclaringType
Returns the declaring type (as reported by the type's generic signature). Not to be confused with the declaring type as stored in the class file. That is stored inNdType.getDeclaringType()
. Any class that is nested inside another class with generic arguments will have one of these. Classes nested inside non-generic classes won't have one of these, and neither will non-nested classes. -
getTypeArguments
Description copied from class:NdTypeSignature
Returns the type arguments for this type signature, if any. Returns the empty list if none.- Specified by:
getTypeArguments
in classNdTypeSignature
-
getArrayDimensionType
Description copied from class:NdTypeSignature
If the receiver is an array type, it returns the signature of the array's next dimension. Returns null if this is not an array type.- Specified by:
getArrayDimensionType
in classNdTypeSignature
-
getSignature
- Specified by:
getSignature
in classNdTypeSignature
-
isTypeVariable
public boolean isTypeVariable()- Specified by:
isTypeVariable
in classNdTypeSignature
-
getDeclaringTypeChain
Description copied from class:NdTypeSignature
Returns the chain of declaring generic types. The first element in the chain is a top-level type and the receiver is the last element in the chain.- Specified by:
getDeclaringTypeChain
in classNdTypeSignature
-
isArrayType
public boolean isArrayType()Description copied from class:NdTypeSignature
Returns true iff this is an array type signature (ie: that getArrayDimensionType() will return a non-null answer). Note that this only returns true for the type signature that holds the reference to the array dimension type. The raw type for that signature will return false, even though it has a field descriptor starting with '['.In other words:
NdVariable someVariable = getSomeVariableWithAnArrayType() System.out.println(someVariable.getType().isArrayType()); // true System.out.println(someVariable.getType().getRawType().isArrayType()); // false
- Specified by:
isArrayType
in classNdTypeSignature
-