|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object checkers.types.QualifierHierarchy
public abstract class QualifierHierarchy extends Object
Represents a type qualifier hierarchy. All method parameter annotations need to be type qualifiers recognized within this hierarchy. This assumes that any particular annotated type in a program is annotated with at most one qualifier from the hierarchy.
Constructor and Description |
---|
QualifierHierarchy()
|
Modifier and Type | Method and Description |
---|---|
protected Set<AnnotationMirror> |
difference(Collection<AnnotationMirror> as1,
Collection<AnnotationMirror> as2)
|
abstract AnnotationMirror |
getRootAnnotation()
|
abstract Set<Name> |
getTypeQualifiers()
Returns the names of all type qualifiers in this type qualifier hierarchy |
protected Set<AnnotationMirror> |
intersect(Collection<AnnotationMirror> as1,
Collection<AnnotationMirror> as2)
|
abstract boolean |
isSubtype(AnnotationMirror anno1,
AnnotationMirror anno2)
Tests whether anno1 is a super qualifier of anno2, according to the type qualifier hierarchy. |
boolean |
isSubtype(Collection<AnnotationMirror> rhs,
Collection<AnnotationMirror> lhs)
Tests whether there is any annotation in lhs that is a super qualifier of some annotation in rhs. |
abstract AnnotationMirror |
leastUpperBound(AnnotationMirror a1,
AnnotationMirror a2)
Returns the least upper bound for a1 and a2 qualifiers. |
Set<AnnotationMirror> |
leastUpperBound(Collection<AnnotationMirror> annos1,
Collection<AnnotationMirror> annos2)
Returns the type qualifiers that are the least upper bound of the qualifiers in annos1 and annos2. |
AnnotationMirror |
validQualifier(Collection<AnnotationMirror> annos)
Deprecated. |
List<AnnotationMirror> |
validQualifiers(Collection<AnnotationMirror> annos)
Deprecated. |
protected Collection<AnnotationMirror> |
wrapCollection(Collection<AnnotationMirror> annos)
Returns a non-null, non-empty collection of annotations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QualifierHierarchy()
Method Detail |
---|
public abstract AnnotationMirror getRootAnnotation()
public abstract Set<Name> getTypeQualifiers()
public abstract boolean isSubtype(AnnotationMirror anno1, AnnotationMirror anno2)
public boolean isSubtype(Collection<AnnotationMirror> rhs, Collection<AnnotationMirror> lhs)
public abstract AnnotationMirror leastUpperBound(AnnotationMirror a1, AnnotationMirror a2)
public Set<AnnotationMirror> leastUpperBound(Collection<AnnotationMirror> annos1, Collection<AnnotationMirror> annos2)
This is necessary for determining the type of a conditional expression (?:), where the type of the expression is the least upper bound of the true and false clauses.
The current implementation returns the intersection of annos1 and annos2 along with the qualifier that is the least upper bound of all other annotations.
@Deprecated public List<AnnotationMirror> validQualifiers(Collection<AnnotationMirror> annos)
Annotated types only contain the supported qualifiers by the hierarchy currently. There is no need to call this method.
@Deprecated public AnnotationMirror validQualifier(Collection<AnnotationMirror> annos)
Annotated types only contain the supported qualifiers by the hierarchy currently. There is no need to call this method.
protected Collection<AnnotationMirror> wrapCollection(Collection<AnnotationMirror> annos)
null
, because
a null value of type AnnotationMirror is treated as an unqualified type.
null
protected Set<AnnotationMirror> intersect(Collection<AnnotationMirror> as1, Collection<AnnotationMirror> as2)
protected Set<AnnotationMirror> difference(Collection<AnnotationMirror> as1, Collection<AnnotationMirror> as2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |