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
FieldsModifier and TypeFieldDescriptionstatic FieldOneToMany<NdComplexTypeSignature>static FieldManyToOne<NdComplexTypeSignature>static FieldManyToOne<NdTypeId>static StructDef<NdComplexTypeSignature>static FieldOneToMany<NdTypeArgument>static FieldStringFields 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
Constructors -
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.voidgetSignature(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.booleanReturns true iff this is an array type signature (ie: that getArrayDimensionType() will return a non-null answer).booleanvoidsetGenericDeclaringType(NdComplexTypeSignature enclosingType)voidsetRawType(NdTypeId rawType)voidsetVariableIdentifier(char[] variableIdentifier)Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.nd.java.NdTypeSignature
getImplementations, getSignature, getSubclasses, getSubTypes, toStringMethods 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:NdTypeSignatureReturns 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:
getRawTypein 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:NdTypeSignatureReturns the type arguments for this type signature, if any. Returns the empty list if none.- Specified by:
getTypeArgumentsin classNdTypeSignature
-
getArrayDimensionType
Description copied from class:NdTypeSignatureIf 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:
getArrayDimensionTypein classNdTypeSignature
-
getSignature
- Specified by:
getSignaturein classNdTypeSignature
-
isTypeVariable
public boolean isTypeVariable()- Specified by:
isTypeVariablein classNdTypeSignature
-
getDeclaringTypeChain
Description copied from class:NdTypeSignatureReturns 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:
getDeclaringTypeChainin classNdTypeSignature
-
isArrayType
public boolean isArrayType()Description copied from class:NdTypeSignatureReturns 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:
isArrayTypein classNdTypeSignature
-