checkers.types
Class AnnotatedTypeMirror.AnnotatedTypeVariable

java.lang.Object
  extended by checkers.types.AnnotatedTypeMirror
      extended by checkers.types.AnnotatedTypeMirror.AnnotatedTypeVariable
All Implemented Interfaces:
AnnotatedTypeMirror.AnnotatedReferenceType
Enclosing class:
AnnotatedTypeMirror

public static class AnnotatedTypeMirror.AnnotatedTypeVariable
extends AnnotatedTypeMirror
implements AnnotatedTypeMirror.AnnotatedReferenceType

Represents a type variable. A type variable may be explicitly declared by a type parameter of a type, method, or constructor. A type variable may also be declared implicitly, as by the capture conversion of a wildcard type argument (see chapter 5 of The Java Language Specification, Third Edition).


Nested Class Summary
Modifier and Type Class and Description
 
Nested classes/interfaces inherited from class checkers.types.AnnotatedTypeMirror
AnnotatedTypeMirror.AnnotatedArrayType, AnnotatedTypeMirror.AnnotatedDeclaredType, AnnotatedTypeMirror.AnnotatedExecutableType, AnnotatedTypeMirror.AnnotatedNoType, AnnotatedTypeMirror.AnnotatedNullType, AnnotatedTypeMirror.AnnotatedPrimitiveType, AnnotatedTypeMirror.AnnotatedReferenceType, AnnotatedTypeMirror.AnnotatedTypeVariable, AnnotatedTypeMirror.AnnotatedWildcardType
 
Field Summary
Modifier and Type Field and Description
 
Fields inherited from class checkers.types.AnnotatedTypeMirror
annotationFactory, annotations, element, enclosingType, env, typeFactory, uid
 
Method Summary
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 anno)
          Adds an annotation to this type.
 boolean equals(Object o)
           
 Set<AnnotationMirror> getAnnotations()
          Returns the annotations on this type.
 Set<AnnotationMirror> getAnnotationsOnTypeVar()
           
 AnnotatedTypeMirror.AnnotatedTypeVariable getCopy(boolean copyAnnotations)
          Returns a shallow copy of this type.
 AnnotatedTypeMirror getErased()
          Returns the erasure type of the this type, according to JLS specifications.
 AnnotatedTypeMirror getLowerBound()
           
 Set<AnnotationMirror> getLowerBoundAnnotations()
           
 Element getTypeVariableElement()
           
 TypeVariable getUnderlyingType()
          Returns the underlying unannotated Java type, which this wraps
 AnnotatedTypeMirror getUpperBound()
           
 Set<AnnotationMirror> getUpperBoundAnnotations()
           
 int hashCode()
           
 boolean isAnnotated()
          Returns true if an annotation targets this type location.
 AnnotatedTypeMirror substitute(Map<? extends AnnotatedTypeMirror,? extends AnnotatedTypeMirror> mappings)
          Return a copy of this, with the given substitutions performed.
 String toString()
           
 
Methods inherited from class checkers.types.AnnotatedTypeMirror
addAnnotation, addAnnotations, clearAnnotations, copyFields, createType, createTypeOfObject, directSuperTypes, directSuperTypes, formatAnnotationString, getAnnotation, getAnnotation, getAnnotation, getElement, getEnclosingType, getKind, hasAnnotation, hasAnnotation, removeAnnotation, removeAnnotation, removeAnnotations, toStringDebug
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

accept

public <R,P> R accept(AnnotatedTypeVisitor<R,P> v,
                      P p)
Description copied from class: AnnotatedTypeMirror
Applies a visitor to this type.

Specified by:
accept in class AnnotatedTypeMirror
Type Parameters:
R - the return type of the visitor's methods
P - the type of the additional parameter to the visitor's methods
Parameters:
v - the visitor operating on this type
p - additional parameter to the visitor
Returns:
a visitor-specified result

getUnderlyingType

public TypeVariable getUnderlyingType()
Description copied from class: AnnotatedTypeMirror
Returns the underlying unannotated Java type, which this wraps

Overrides:
getUnderlyingType in class AnnotatedTypeMirror
Returns:
the underlying type

getTypeVariableElement

public Element getTypeVariableElement()
Returns:
the element of the type variable in this

getLowerBound

public AnnotatedTypeMirror getLowerBound()
Returns:
the lower bound type of this type variable
See Also:
getLowerBoundAnnotations()

getLowerBoundAnnotations

public Set<AnnotationMirror> getLowerBoundAnnotations()
Returns:
the effective lower bound annotations: the annotations on this, or if none, those on the lower bound

getUpperBound

public AnnotatedTypeMirror getUpperBound()
Returns:
the upper bound type of this type variable
See Also:
getUpperBoundAnnotations()

getUpperBoundAnnotations

public Set<AnnotationMirror> getUpperBoundAnnotations()
Returns:
the effective upper bound annotations: the annotations on this, or if none, those on the upper bound

getCopy

public AnnotatedTypeMirror.AnnotatedTypeVariable getCopy(boolean copyAnnotations)
Description copied from class: AnnotatedTypeMirror
Returns a shallow copy of this type.

Specified by:
getCopy in class AnnotatedTypeMirror
Parameters:
copyAnnotations - whether copy should have annotations

getErased

public AnnotatedTypeMirror getErased()
Description copied from class: AnnotatedTypeMirror
Returns the erasure type of the this type, according to JLS specifications.

Overrides:
getErased in class AnnotatedTypeMirror
Returns:
the erasure of this

substitute

public AnnotatedTypeMirror substitute(Map<? extends AnnotatedTypeMirror,? extends AnnotatedTypeMirror> mappings)
Description copied from class: AnnotatedTypeMirror
Return a copy of this, with the given substitutions performed.

Overrides:
substitute in class AnnotatedTypeMirror

isAnnotated

public boolean isAnnotated()
Description copied from class: AnnotatedTypeMirror
Returns true if an annotation targets this type location. It doesn't account for annotations in deep types (type arguments, array components, etc).

Overrides:
isAnnotated in class AnnotatedTypeMirror

getAnnotationsOnTypeVar

public Set<AnnotationMirror> getAnnotationsOnTypeVar()

getAnnotations

public Set<AnnotationMirror> getAnnotations()
Description copied from class: AnnotatedTypeMirror
Returns the annotations on this type. It does not include annotations in deep types (type arguments, array components, etc).

Overrides:
getAnnotations in class AnnotatedTypeMirror
Returns:
a set of the annotations on this

addAnnotation

public void addAnnotation(AnnotationMirror anno)
Description copied from class: AnnotatedTypeMirror
Adds an annotation to this type. If the annotation does not have the TypeQualifier meta-annotation, this method has no effect.

Overrides:
addAnnotation in class AnnotatedTypeMirror
Parameters:
anno - the annotation to add

toString

public String toString()
Overrides:
toString in class AnnotatedTypeMirror

hashCode

public int hashCode()
Overrides:
hashCode in class AnnotatedTypeMirror

equals

public boolean equals(Object o)
Overrides:
equals in class AnnotatedTypeMirror