public static class AnnotatedTypeMirror.AnnotatedTypeVariable extends AnnotatedTypeMirror
AnnotatedTypeMirror.AnnotatedArrayType, AnnotatedTypeMirror.AnnotatedDeclaredType, AnnotatedTypeMirror.AnnotatedExecutableType, AnnotatedTypeMirror.AnnotatedIntersectionType, AnnotatedTypeMirror.AnnotatedNoType, AnnotatedTypeMirror.AnnotatedNullType, AnnotatedTypeMirror.AnnotatedPrimitiveType, AnnotatedTypeMirror.AnnotatedTypeVariable, AnnotatedTypeMirror.AnnotatedUnionType, AnnotatedTypeMirror.AnnotatedWildcardTypeactualType, atypeFactory, equalityComparer, hashcodeVisitor| Modifier and Type | Method and Description |
|---|---|
<R,P> R |
accept(AnnotatedTypeVisitor<R,P> v,
P p)
Applies a visitor to this type.
|
void |
addAnnotation(AnnotationMirror a)
Adds an annotation to this type.
|
AnnotatedTypeMirror.AnnotatedTypeVariable |
asUse() |
AnnotatedTypeMirror.AnnotatedTypeVariable |
deepCopy() |
AnnotatedTypeMirror.AnnotatedTypeVariable |
deepCopy(boolean copyAnnotations)
Returns a deep copy of this type.
|
AnnotatedTypeParameterBounds |
getBoundFields() |
AnnotatedTypeParameterBounds |
getBounds() |
AnnotatedTypeMirror |
getErased()
This method will traverse the upper bound of this type variable calling getErased until
it finds the concrete upper bound.
|
AnnotatedTypeMirror |
getLowerBound() |
AnnotatedTypeMirror |
getLowerBoundField()
Get the lower bound field directly, bypassing any lazy initialization.
|
TypeVariable |
getUnderlyingType()
Returns the underlying unannotated Java type, which this wraps
|
AnnotatedTypeMirror |
getUpperBound()
Get the upper bound of the type variable, possibly lazily initializing it.
|
AnnotatedTypeMirror |
getUpperBoundField()
Get the upper bound field directly, bypassing any lazy initialization.
|
boolean |
isDeclaration()
Returns true if this type mirror represents a declaration, rather than a use, of a type.
|
void |
setDeclaration(boolean declaration)
Change whether this
AnnotatedTypeVariable is considered a use or a declaration
(use this method with caution). |
AnnotatedTypeMirror.AnnotatedTypeVariable |
shallowCopy()
Returns a shallow copy of this type with annotations.
|
AnnotatedTypeMirror.AnnotatedTypeVariable |
shallowCopy(boolean copyAnnotations)
Returns a shallow copy of this type.
|
addAnnotation, addAnnotations, addMissingAnnotations, clearAnnotations, createType, createTypeOfObject, directSuperTypes, 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, toStringpublic 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 void addAnnotation(AnnotationMirror a)
AnnotatedTypeMirroraddAnnotation in class AnnotatedTypeMirrora - the annotation to addpublic void setDeclaration(boolean declaration)
AnnotatedTypeVariable is considered a use or a declaration
(use this method with caution).declaration - true if this type variable should be considered a declarationpublic AnnotatedTypeMirror.AnnotatedTypeVariable 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 TypeVariable getUnderlyingType()
AnnotatedTypeMirrorgetUnderlyingType in class AnnotatedTypeMirrorpublic AnnotatedTypeMirror getLowerBoundField()
public AnnotatedTypeMirror getLowerBound()
public AnnotatedTypeMirror getUpperBoundField()
public AnnotatedTypeMirror getUpperBound()
public AnnotatedTypeParameterBounds getBounds()
public AnnotatedTypeParameterBounds getBoundFields()
public AnnotatedTypeMirror.AnnotatedTypeVariable deepCopy(boolean copyAnnotations)
AnnotatedTypeMirrorNote: deepCopy provides two important properties in the returned copy:
deepCopy in class AnnotatedTypeMirrorpublic AnnotatedTypeMirror.AnnotatedTypeVariable deepCopy()
deepCopy in class AnnotatedTypeMirrorAnnotatedTypeMirror.deepCopy(boolean)public AnnotatedTypeMirror.AnnotatedTypeVariable shallowCopy(boolean copyAnnotations)
AnnotatedTypeMirrorshallowCopy in class AnnotatedTypeMirrorcopyAnnotations - whether copy should have annotations, i.e. whether field annotations should be copied.public AnnotatedTypeMirror.AnnotatedTypeVariable shallowCopy()
AnnotatedTypeMirrorshallowCopy in class AnnotatedTypeMirrorAnnotatedTypeMirror.shallowCopy(boolean)public AnnotatedTypeMirror getErased()
<E extends T>, T extends S, S extends List<String>>
A call to getErased will return the type ListgetErased in class AnnotatedTypeMirrorIMPORTANT NOTE: getErased should always return a FRESH object. This will occur for type variables if all other getErased methods are implemented appropriately. Therefore, to avoid extra copy calls, this method will not call deepCopy on getUpperBound