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.AnnotatedWildcardType
actualType, annotations, 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, getAnnotationInHierarchy, getAnnotations, getAnnotationsField, getEffectiveAnnotation, getEffectiveAnnotationInHierarchy, getEffectiveAnnotations, getExplicitAnnotations, getKind, hasAnnotation, hasAnnotation, hasAnnotationRelaxed, hasEffectiveAnnotation, hasEffectiveAnnotation, hasEffectiveAnnotationRelaxed, hasExplicitAnnotation, hasExplicitAnnotation, hasExplicitAnnotationRelaxed, hashCode, isAnnotatedInHierarchy, removeAnnotation, removeAnnotation, removeAnnotationInHierarchy, removeAnnotations, removeNonTopAnnotationInHierarchy, replaceAnnotation, replaceAnnotations, toString, toString
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 void addAnnotation(AnnotationMirror a)
AnnotatedTypeMirror
addAnnotation
in class AnnotatedTypeMirror
a
- 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 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 TypeVariable getUnderlyingType()
AnnotatedTypeMirror
getUnderlyingType
in class AnnotatedTypeMirror
public AnnotatedTypeMirror getLowerBoundField()
public AnnotatedTypeMirror getLowerBound()
public AnnotatedTypeMirror getUpperBoundField()
public AnnotatedTypeMirror getUpperBound()
public AnnotatedTypeParameterBounds getBounds()
public AnnotatedTypeParameterBounds getBoundFields()
public AnnotatedTypeMirror.AnnotatedTypeVariable deepCopy(boolean copyAnnotations)
AnnotatedTypeMirror
Note: deepCopy provides two important properties in the returned copy:
deepCopy
in class AnnotatedTypeMirror
public AnnotatedTypeMirror.AnnotatedTypeVariable deepCopy()
deepCopy
in class AnnotatedTypeMirror
AnnotatedTypeMirror.deepCopy(boolean)
public AnnotatedTypeMirror.AnnotatedTypeVariable shallowCopy(boolean copyAnnotations)
AnnotatedTypeMirror
shallowCopy
in class AnnotatedTypeMirror
copyAnnotations
- whether copy should have annotations, i.e. whether field annotations
should be copied.public AnnotatedTypeMirror.AnnotatedTypeVariable shallowCopy()
AnnotatedTypeMirror
shallowCopy
in class AnnotatedTypeMirror
AnnotatedTypeMirror.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 AnnotatedTypeMirror
IMPORTANT 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