@AnnotatedFor(value="nullness") public interface QualifierKindHierarchy
QualifierKind
class. If a type system has more than one hierarchy, information about all hierarchies is stored
in this class.
The qualifier kind subtyping relationship may be an over-approximation of the qualifier subtyping relationship, for qualifiers that have elements/arguments. In other words, if a qualifier kind is a subtype of another qualifier kind, then qualifiers of those kinds may or may not be subtypes, depending on the values of any elements of the qualifiers. If qualifier kinds are not subtypes, then qualifiers of those kinds are never subtypes.
This interface is used by NoElementQualifierHierarchy
and ElementQualifierHierarchy
(but not MostlyNoElementQualifierHierarchy
) to
implement methods that compare AnnotationMirror
s, such as QualifierHierarchy.isSubtype(AnnotationMirror,
AnnotationMirror)
.
Modifier and Type | Method and Description |
---|---|
List<? extends QualifierKind> |
allQualifierKinds()
Returns a list of all
QualifierKind s sorted in ascending order. |
static @CanonicalName String |
annotationClassName(Class<? extends Annotation> clazz)
Returns the canonical name of
clazz . |
Set<? extends QualifierKind> |
getBottoms()
Returns the qualifier kinds that are the bottom qualifier in their hierarchies.
|
@Nullable QualifierKind |
getQualifierKind(@CanonicalName String name)
Returns the
QualifierKind for the given annotation class name, or null if one does
not exist. |
Set<? extends QualifierKind> |
getTops()
Returns the qualifier kinds that are the top qualifier in their hierarchies.
|
@Nullable QualifierKind |
greatestLowerBound(QualifierKind q1,
QualifierKind q2)
Returns the greatest lower bound of
q1 and q2 , or null if the
qualifier kinds are not in the same hierarchy. |
@Nullable QualifierKind |
leastUpperBound(QualifierKind q1,
QualifierKind q2)
Returns the least upper bound of
q1 and q2 , or null if the qualifier
kinds are not in the same hierarchy. |
Set<? extends QualifierKind> getTops()
Set<? extends QualifierKind> getBottoms()
@Nullable QualifierKind leastUpperBound(QualifierKind q1, QualifierKind q2)
q1
and q2
, or null
if the qualifier
kinds are not in the same hierarchy. Ignores elements/arguments (as QualifierKind always
does).q1
- a qualifier kindq2
- a qualifier kindq1
and q2
, or null
if the qualifier
kinds are not in the same hierarchy@Nullable QualifierKind greatestLowerBound(QualifierKind q1, QualifierKind q2)
q1
and q2
, or null
if the
qualifier kinds are not in the same hierarchy. Ignores elements/arguments (as QualifierKind
always does).q1
- a qualifier kindq2
- a qualifier kindq1
and q2
, or null
if the
qualifier kinds are not in the same hierarchyList<? extends QualifierKind> allQualifierKinds()
QualifierKind
s sorted in ascending order.QualifierKind
s sorted in ascending order@Nullable QualifierKind getQualifierKind(@CanonicalName String name)
QualifierKind
for the given annotation class name, or null if one does
not exist.name
- canonical name of an annotation classQualifierKind
for the given annotation class name, or null if one does
not existstatic @CanonicalName String annotationClassName(Class<? extends Annotation> clazz)
clazz
. Throws a TypeSystemError
if clazz
is anonymous or otherwise does not have a name.clazz
- annotation classclazz