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.AnnotatedWildcardTypeannotations, 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.
|
void |
addAnnotation(AnnotationMirror a)
Adds an annotation to this type.
|
AnnotatedTypeMirror.AnnotatedTypeVariable |
asUse() |
AnnotatedTypeMirror.AnnotatedTypeVariable |
deepCopy()
Returns a deep copy of this type with annotations.
|
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()
Returns the lower bound type of this type variable.
|
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, clearPrimaryAnnotations, containsUninferredTypeArguments, createType, createTypeOfObject, directSupertypes, 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, 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()
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.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()
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 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