public class QualifierDefaults extends Object
DefaultQualifier
annotation.DefaultQualifier
Modifier and Type | Class and Description |
---|---|
static class |
QualifierDefaults.DefaultApplierElement |
Modifier and Type | Field and Description |
---|---|
protected static Map<Element,org.checkerframework.framework.util.defaults.QualifierDefaults.BoundType> |
elementToBoundType |
static TypeUseLocation[] |
STANDARD_CLIMB_DEFAULTS_BOTTOM
CLIMB locations whose standard default is bottom for a given type system.
|
static TypeUseLocation[] |
STANDARD_CLIMB_DEFAULTS_TOP
CLIMB locations whose standard default is top for a given type system.
|
static TypeUseLocation[] |
STANDARD_UNCHECKED_DEFAULTS_BOTTOM
Standard unchecked default locations that should be bottom.
|
static TypeUseLocation[] |
STANDARD_UNCHECKED_DEFAULTS_TOP
Standard unchecked default locations that should be top.
|
Constructor and Description |
---|
QualifierDefaults(Elements elements,
AnnotatedTypeFactory atypeFactory) |
Modifier and Type | Method and Description |
---|---|
void |
addCheckedCodeDefault(AnnotationMirror absoluteDefaultAnno,
TypeUseLocation location)
Sets the default annotations.
|
void |
addCheckedCodeDefaults(AnnotationMirror absoluteDefaultAnno,
TypeUseLocation[] locations) |
void |
addClimbStandardDefaults()
Add standard CLIMB defaults that do not conflict with previously added defaults.
|
void |
addElementDefault(Element elem,
AnnotationMirror elementDefaultAnno,
TypeUseLocation location)
Sets the default annotations for a certain Element.
|
void |
addUncheckedCodeDefault(AnnotationMirror uncheckedDefaultAnno,
TypeUseLocation location)
Sets the default annotation for unchecked elements.
|
void |
addUncheckedCodeDefaults(AnnotationMirror absoluteDefaultAnno,
TypeUseLocation[] locations)
Sets the default annotation for unchecked elements, with specific locations.
|
void |
addUncheckedStandardDefaults()
Add standard unchecked defaults that do not conflict with previously added defaults.
|
void |
annotate(Element elt,
AnnotatedTypeMirror type)
Applies default annotations to a type given an
Element . |
void |
annotate(Tree tree,
AnnotatedTypeMirror type)
Applies default annotations to a type given a
Tree . |
boolean |
applyConservativeDefaults(Element annotationScope)
Given an element, returns whether the conservative default should be applied for it.
|
protected QualifierDefaults.DefaultApplierElement |
createDefaultApplierElement(AnnotatedTypeFactory atypeFactory,
Element annotationScope,
AnnotatedTypeMirror type,
boolean applyToTypeVar) |
static org.checkerframework.framework.util.defaults.QualifierDefaults.BoundType |
getWildcardBoundType(AnnotatedTypeMirror.AnnotatedWildcardType annotatedWildcard,
AnnotatedTypeFactory typeFactory) |
boolean |
hasDefaultsForCheckedCode()
Check that a default with TypeUseLocation OTHERWISE or ALL is specified.
|
String |
toString() |
static TypeUseLocation[] |
validLocationsForUncheckedCodeDefaults()
Returns an array of locations that are valid for the unchecked value defaults.
|
protected static final Map<Element,org.checkerframework.framework.util.defaults.QualifierDefaults.BoundType> elementToBoundType
public static final TypeUseLocation[] STANDARD_CLIMB_DEFAULTS_TOP
public static final TypeUseLocation[] STANDARD_CLIMB_DEFAULTS_BOTTOM
public static final TypeUseLocation[] STANDARD_UNCHECKED_DEFAULTS_TOP
public static final TypeUseLocation[] STANDARD_UNCHECKED_DEFAULTS_BOTTOM
public QualifierDefaults(Elements elements, AnnotatedTypeFactory atypeFactory)
elements
- interface to Element data in the current processing environmentatypeFactory
- an annotation factory, used to get annotations by namepublic static TypeUseLocation[] validLocationsForUncheckedCodeDefaults()
public boolean hasDefaultsForCheckedCode()
public void addUncheckedStandardDefaults()
public void addClimbStandardDefaults()
public void addCheckedCodeDefault(AnnotationMirror absoluteDefaultAnno, TypeUseLocation location)
public void addUncheckedCodeDefault(AnnotationMirror uncheckedDefaultAnno, TypeUseLocation location)
public void addUncheckedCodeDefaults(AnnotationMirror absoluteDefaultAnno, TypeUseLocation[] locations)
public void addCheckedCodeDefaults(AnnotationMirror absoluteDefaultAnno, TypeUseLocation[] locations)
public void addElementDefault(Element elem, AnnotationMirror elementDefaultAnno, TypeUseLocation location)
public void annotate(Element elt, AnnotatedTypeMirror type)
Element
.elt
- the element from which the type was obtainedtype
- the type to annotatepublic void annotate(Tree tree, AnnotatedTypeMirror type)
Tree
.tree
- the tree from which the type was obtainedtype
- the type to annotatepublic boolean applyConservativeDefaults(Element annotationScope)
annotationScope
- the element that the conservative default might apply toprotected QualifierDefaults.DefaultApplierElement createDefaultApplierElement(AnnotatedTypeFactory atypeFactory, Element annotationScope, AnnotatedTypeMirror type, boolean applyToTypeVar)
public static org.checkerframework.framework.util.defaults.QualifierDefaults.BoundType getWildcardBoundType(AnnotatedTypeMirror.AnnotatedWildcardType annotatedWildcard, AnnotatedTypeFactory typeFactory)