public static class AnnotatedTypeMirror.AnnotatedDeclaredType extends AnnotatedTypeMirror
AnnotatedTypeMirror.AnnotatedArrayType, AnnotatedTypeMirror.AnnotatedDeclaredType, AnnotatedTypeMirror.AnnotatedExecutableType, AnnotatedTypeMirror.AnnotatedIntersectionType, AnnotatedTypeMirror.AnnotatedNoType, AnnotatedTypeMirror.AnnotatedNullType, AnnotatedTypeMirror.AnnotatedPrimitiveType, AnnotatedTypeMirror.AnnotatedTypeVariable, AnnotatedTypeMirror.AnnotatedUnionType, AnnotatedTypeMirror.AnnotatedWildcardType| Modifier and Type | Field and Description |
|---|---|
protected @Nullable AnnotatedTypeMirror.AnnotatedDeclaredType |
enclosingType
The enclosing type.
|
protected List<AnnotatedTypeMirror> |
typeArgs
Parametrized Type Arguments.
|
annotations, atypeFactory, EQUALITY_COMPARER, HASHCODE_VISITOR, underlyingType| Modifier and Type | Method and Description |
|---|---|
<R,P> R |
accept(AnnotatedTypeVisitor<R,P> v,
P p)
Applies a visitor to this type.
|
AnnotatedTypeMirror.AnnotatedDeclaredType |
asUse() |
AnnotatedTypeMirror.AnnotatedDeclaredType |
deepCopy()
Returns a deep copy of this type with annotations.
|
AnnotatedTypeMirror.AnnotatedDeclaredType |
deepCopy(boolean copyAnnotations)
Returns a deep copy of this type.
|
List<AnnotatedTypeMirror.AnnotatedDeclaredType> |
directSupertypes()
This method returns a list of AnnotatedTypeMirrors where the Java type of each ATM is an
immediate supertype (class or interface) of the Java type of this.
|
@Nullable AnnotatedTypeMirror.AnnotatedDeclaredType |
getEnclosingType()
Returns the enclosing type, as in the type of
A in the type A.B. |
AnnotatedTypeMirror.AnnotatedDeclaredType |
getErased()
Return the declared type with its type arguments removed.
|
List<AnnotatedTypeMirror> |
getTypeArguments()
Returns the type argument for this type.
|
DeclaredType |
getUnderlyingType()
Returns the underlying unannotated Java type, which this wraps.
|
boolean |
isDeclaration()
Returns true if this type mirror represents a declaration, rather than a use, of a type.
|
boolean |
isUnderlyingTypeRaw()
Returns true if the underlying type is raw.
|
protected void |
setIsUnderlyingTypeRaw()
Set the isUnderlyingTypeRaw flag to true.
|
void |
setTypeArguments(List<? extends AnnotatedTypeMirror> ts)
Sets the type arguments on this type.
|
protected void |
setWasRaw()
Deprecated.
Use
setIsUnderlyingTypeRaw() instead |
AnnotatedTypeMirror.AnnotatedDeclaredType |
shallowCopy()
Returns a shallow copy of this type with annotations.
|
AnnotatedTypeMirror.AnnotatedDeclaredType |
shallowCopy(boolean copyAnnotations)
Returns a shallow copy of this type.
|
boolean |
wasRaw()
Deprecated.
Use
isUnderlyingTypeRaw() instead |
addAnnotation, addAnnotation, addAnnotations, addMissingAnnotations, clearPrimaryAnnotations, containsUninferredTypeArguments, createType, createTypeOfObject, equals, getAnnotation, getAnnotation, getAnnotation, getAnnotationInHierarchy, getAnnotations, getAnnotationsField, getEffectiveAnnotation, getEffectiveAnnotationInHierarchy, getEffectiveAnnotations, getExplicitAnnotations, getKind, getPrimitiveKind, getUnderlyingTypeHashCode, hasAnnotation, hasAnnotation, hasAnnotationRelaxed, hasEffectiveAnnotation, hasEffectiveAnnotation, hasEffectiveAnnotationRelaxed, hasExplicitAnnotation, hasExplicitAnnotation, hasExplicitAnnotationRelaxed, hashCode, isAnnotatedInHierarchy, removeAnnotation, removeAnnotationByClass, removeAnnotationInHierarchy, removeAnnotations, removeNonTopAnnotationInHierarchy, replaceAnnotation, replaceAnnotations, toString, toStringprotected List<AnnotatedTypeMirror> typeArgs
protected @Nullable AnnotatedTypeMirror.AnnotatedDeclaredType enclosingType
public boolean isDeclaration()
AnnotatedTypeMirrorFor example, class List<T> { ... } declares a new type List<T>, while List<Integer> is a use of the type.
isDeclaration in class AnnotatedTypeMirrorpublic AnnotatedTypeMirror.AnnotatedDeclaredType deepCopy(boolean copyAnnotations)
AnnotatedTypeMirrorNote: deepCopy provides two important properties in the returned copy:
deepCopy in class AnnotatedTypeMirrorpublic AnnotatedTypeMirror.AnnotatedDeclaredType deepCopy()
AnnotatedTypeMirrorEach subclass implements this method with the subclass return type. The method body must always be a call to deepCopy(true).
deepCopy in class AnnotatedTypeMirrorAnnotatedTypeMirror.deepCopy(boolean)public AnnotatedTypeMirror.AnnotatedDeclaredType asUse()
asUse in class AnnotatedTypeMirrorpublic <R,P> R accept(AnnotatedTypeVisitor<R,P> v, P p)
AnnotatedTypeMirroraccept in class AnnotatedTypeMirrorR - the return type of the visitor's methodsP - the type of the additional parameter to the visitor's methodsv - the visitor operating on this typep - additional parameter to the visitorpublic void setTypeArguments(List<? extends AnnotatedTypeMirror> ts)
ts - the type argumentspublic List<AnnotatedTypeMirror> getTypeArguments()
public boolean isUnderlyingTypeRaw()
@Deprecated public boolean wasRaw()
isUnderlyingTypeRaw() insteadprotected void setIsUnderlyingTypeRaw()
@Deprecated protected void setWasRaw()
setIsUnderlyingTypeRaw() insteadpublic DeclaredType getUnderlyingType()
AnnotatedTypeMirrorgetUnderlyingType in class AnnotatedTypeMirrorpublic List<AnnotatedTypeMirror.AnnotatedDeclaredType> directSupertypes()
AnnotatedTypeMirrorFor example,
The direct supertype of the ATMclass B<T> { ... }class A extends B<@NonNull String> { ... }@Nullable A a;
@Nullable A is @Nullable B<@NonNull String>.
An example with more complex type arguments:
The direct supertype of the ATMclass D<Q,R> { ... }class A<T,S> extends D<S,T> { ... }@Nullable A<@NonNull String, @NonNull Object> a;
@Nullable A<@NonNull String, @NonNull Object> is
@Nullable B<@NonNull Object, @NonNull String>.
An example with more than one direct supertype:
The direct supertypes of the ATMclass B<T> implements List<Integer> { ... }class A extends B<@NonNull String> implements List<Integer> { ... }@Nullable A a;
@Nullable A are @Nullable B <@NonNull String>
and @Nullable List<@NonNull Integer>.directSupertypes in class AnnotatedTypeMirrorTypes.directSupertypes(TypeMirror)public AnnotatedTypeMirror.AnnotatedDeclaredType shallowCopy()
AnnotatedTypeMirrorEach subclass implements this method with the subclass return type. The method body must always be a call to shallowCopy(true).
shallowCopy in class AnnotatedTypeMirrorAnnotatedTypeMirror.shallowCopy(boolean)public AnnotatedTypeMirror.AnnotatedDeclaredType shallowCopy(boolean copyAnnotations)
AnnotatedTypeMirrorshallowCopy in class AnnotatedTypeMirrorcopyAnnotations - whether copy should have annotations, i.e. whether field annotations should be copied.public AnnotatedTypeMirror.AnnotatedDeclaredType getErased()
getErased in class AnnotatedTypeMirrorpublic @Nullable AnnotatedTypeMirror.AnnotatedDeclaredType getEnclosingType()
A in the type A.B. May return
null.