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 AnnotatedTypeMirror.AnnotatedDeclaredType |
enclosingType
The enclosing Type
|
protected List<AnnotatedTypeMirror.AnnotatedDeclaredType> |
supertypes |
protected List<AnnotatedTypeMirror> |
typeArgs
Parametrized Type Arguments
|
actualType, atypeFactory, equalityComparer, formatter, hashcodeVisitor
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() |
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.
|
List<AnnotatedTypeMirror.AnnotatedDeclaredType> |
directSuperTypesField() |
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() |
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.
|
void |
setTypeArguments(List<? extends AnnotatedTypeMirror> ts)
Sets the type arguments on this type
|
protected void |
setWasRaw()
Set the wasRaw flag to true.
|
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()
Returns true if the type was raw, that is, type arguments were not provided but instead
inferred.
|
addAnnotation, addAnnotation, addAnnotations, addMissingAnnotations, clearAnnotations, createType, createTypeOfObject, equals, getAnnotation, getAnnotation, getAnnotation, getAnnotationInHierarchy, getAnnotations, getAnnotationsField, getEffectiveAnnotation, getEffectiveAnnotationInHierarchy, getEffectiveAnnotations, getExplicitAnnotations, getKind, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotationRelaxed, hasEffectiveAnnotation, hasEffectiveAnnotation, hasEffectiveAnnotationRelaxed, hasExplicitAnnotation, hasExplicitAnnotation, hasExplicitAnnotationRelaxed, hashCode, isAnnotatedInHierarchy, removeAnnotation, removeAnnotation, removeAnnotationInHierarchy, removeAnnotations, removeNonTopAnnotationInHierarchy, replaceAnnotation, replaceAnnotations, toString, toString
protected List<AnnotatedTypeMirror> typeArgs
protected AnnotatedTypeMirror.AnnotatedDeclaredType enclosingType
protected List<AnnotatedTypeMirror.AnnotatedDeclaredType> supertypes
public boolean isDeclaration()
AnnotatedTypeMirror
For example, class List<T> { ... }
declares a new type List<T>
, while
List<Integer>
is a use of the type.
isDeclaration
in class AnnotatedTypeMirror
public AnnotatedTypeMirror.AnnotatedDeclaredType deepCopy(boolean copyAnnotations)
AnnotatedTypeMirror
Note: deepCopy provides two important properties in the returned copy:
deepCopy
in class AnnotatedTypeMirror
public AnnotatedTypeMirror.AnnotatedDeclaredType deepCopy()
deepCopy
in class AnnotatedTypeMirror
AnnotatedTypeMirror.deepCopy(boolean)
public AnnotatedTypeMirror.AnnotatedDeclaredType asUse()
asUse
in class AnnotatedTypeMirror
public <R,P> R accept(AnnotatedTypeVisitor<R,P> v, P p)
AnnotatedTypeMirror
accept
in class AnnotatedTypeMirror
R
- 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 wasRaw()
protected void setWasRaw()
public DeclaredType getUnderlyingType()
AnnotatedTypeMirror
getUnderlyingType
in class AnnotatedTypeMirror
public List<AnnotatedTypeMirror.AnnotatedDeclaredType> directSuperTypes()
AnnotatedTypeMirror
For 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 AnnotatedTypeMirror
Types.directSupertypes(TypeMirror)
public List<AnnotatedTypeMirror.AnnotatedDeclaredType> directSuperTypesField()
public AnnotatedTypeMirror.AnnotatedDeclaredType shallowCopy()
AnnotatedTypeMirror
shallowCopy
in class AnnotatedTypeMirror
AnnotatedTypeMirror.shallowCopy(boolean)
public AnnotatedTypeMirror.AnnotatedDeclaredType shallowCopy(boolean copyAnnotations)
AnnotatedTypeMirror
shallowCopy
in class AnnotatedTypeMirror
copyAnnotations
- whether copy should have annotations, i.e. whether field annotations
should be copied.public AnnotatedTypeMirror.AnnotatedDeclaredType getErased()
getErased
in class AnnotatedTypeMirror
public AnnotatedTypeMirror.AnnotatedDeclaredType getEnclosingType()
A
in the type A.B
.