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[] |
standardClimbDefaultsBottom
CLIMB locations whose standard default is bottom for a given type system.
|
static TypeUseLocation[] |
standardClimbDefaultsTop
CLIMB locations whose standard default is top for a given type system.
|
static TypeUseLocation[] |
standardUncheckedDefaultsBottom
Standard unchecked default locations that should be bottom
|
static TypeUseLocation[] |
standardUncheckedDefaultsTop
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 |
applyUncheckedCodeDefaults(Element annotationScope) |
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[] standardClimbDefaultsTop
public static final TypeUseLocation[] standardClimbDefaultsBottom
public static final TypeUseLocation[] standardUncheckedDefaultsTop
public static final TypeUseLocation[] standardUncheckedDefaultsBottom
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 applyUncheckedCodeDefaults(Element annotationScope)
protected 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)