Class QualifierDefaults.DefaultApplierElement
java.lang.Object
org.checkerframework.framework.util.defaults.QualifierDefaults.DefaultApplierElement
- Enclosing class:
- QualifierDefaults
A default applier element.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AnnotatedTypeFactory
The annotated type factory.The default element applier implementation.protected TypeUseLocation
Location to which to apply the default.protected final Element
The scope of the default.protected final AnnotatedTypeMirror
The type to which to apply the default. -
Constructor Summary
ConstructorDescriptionDefaultApplierElement
(AnnotatedTypeFactory atypeFactory, Element scope, AnnotatedTypeMirror type, boolean applyToTypeVar) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAnnotation
(AnnotatedTypeMirror type, AnnotationMirror qual) Add the qualifier to the type if it does not already have an annotation in the same hierarchy as qual.void
applyDefault
(Default def) Apply default to the type.protected boolean
shouldBeAnnotated
(AnnotatedTypeMirror type, boolean applyToTypeVar) Returns true if the given qualifier should be applied to the given type.
-
Field Details
-
atypeFactory
The annotated type factory. -
scope
The scope of the default. -
type
The type to which to apply the default. -
location
Location to which to apply the default. (Should only be set by the applyDefault method.) -
impl
The default element applier implementation.
-
-
Constructor Details
-
DefaultApplierElement
public DefaultApplierElement(AnnotatedTypeFactory atypeFactory, Element scope, AnnotatedTypeMirror type, boolean applyToTypeVar)
-
-
Method Details
-
applyDefault
Apply default to the type.- Parameters:
def
- default to apply
-
shouldBeAnnotated
Returns true if the given qualifier should be applied to the given type. Currently we do not apply defaults to void types, packages, wildcards, and type variables.- Parameters:
type
- type to which qual would be applied- Returns:
- true if this application should proceed
-
addAnnotation
Add the qualifier to the type if it does not already have an annotation in the same hierarchy as qual.- Parameters:
type
- type to add qualqual
- annotation to add
-