public class QualifierDefaults
extends java.lang.Object
DefaultQualifier
annotation.DefaultQualifier
Modifier and Type | Class and Description |
---|---|
static class |
QualifierDefaults.DefaultApplierElement |
Modifier and Type | Field and Description |
---|---|
protected static java.util.Map<javax.lang.model.element.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(javax.lang.model.util.Elements elements,
AnnotatedTypeFactory atypeFactory) |
Modifier and Type | Method and Description |
---|---|
void |
addCheckedCodeDefault(javax.lang.model.element.AnnotationMirror absoluteDefaultAnno,
TypeUseLocation location)
Sets the default annotations.
|
void |
addCheckedCodeDefaults(javax.lang.model.element.AnnotationMirror absoluteDefaultAnno,
TypeUseLocation[] locations) |
void |
addClimbStandardDefaults(java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> tops,
java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> bottoms)
Add standard CLIMB defaults that do not conflict with previously added defaults.
|
void |
addElementDefault(javax.lang.model.element.Element elem,
javax.lang.model.element.AnnotationMirror elementDefaultAnno,
TypeUseLocation location)
Sets the default annotations for a certain Element.
|
void |
addUncheckedCodeDefault(javax.lang.model.element.AnnotationMirror uncheckedDefaultAnno,
TypeUseLocation location)
Sets the default annotation for unchecked elements.
|
void |
addUncheckedCodeDefaults(javax.lang.model.element.AnnotationMirror absoluteDefaultAnno,
TypeUseLocation[] locations)
Sets the default annotation for unchecked elements, with specific locations.
|
void |
addUncheckedStandardDefaults(java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> tops,
java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> bottoms)
Add standard unchecked defaults that do not conflict with previously added defaults.
|
void |
annotate(javax.lang.model.element.Element elt,
AnnotatedTypeMirror type)
Applies default annotations to a type given an
Element . |
void |
annotate(com.sun.source.tree.Tree tree,
AnnotatedTypeMirror type)
Applies default annotations to a type given a
Tree . |
boolean |
applyUncheckedCodeDefaults(javax.lang.model.element.Element annotationScope) |
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.
|
java.lang.String |
toString() |
static TypeUseLocation[] |
validLocationsForUncheckedCodeDefaults()
Returns an array of locations that are valid for the unchecked value defaults.
|
protected static final java.util.Map<javax.lang.model.element.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(javax.lang.model.util.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 java.lang.String toString()
toString
in class java.lang.Object
public boolean hasDefaultsForCheckedCode()
public void addUncheckedStandardDefaults(java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> tops, java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> bottoms)
tops
- AnnotationMirrors that are topbottoms
- AnnotationMirrors that are bottompublic void addClimbStandardDefaults(java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> tops, java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> bottoms)
tops
- AnnotationMirrors that are topbottoms
- AnnotationMirrors that are bottompublic void addCheckedCodeDefault(javax.lang.model.element.AnnotationMirror absoluteDefaultAnno, TypeUseLocation location)
public void addUncheckedCodeDefault(javax.lang.model.element.AnnotationMirror uncheckedDefaultAnno, TypeUseLocation location)
public void addUncheckedCodeDefaults(javax.lang.model.element.AnnotationMirror absoluteDefaultAnno, TypeUseLocation[] locations)
public void addCheckedCodeDefaults(javax.lang.model.element.AnnotationMirror absoluteDefaultAnno, TypeUseLocation[] locations)
public void addElementDefault(javax.lang.model.element.Element elem, javax.lang.model.element.AnnotationMirror elementDefaultAnno, TypeUseLocation location)
public void annotate(javax.lang.model.element.Element elt, AnnotatedTypeMirror type)
Element
.elt
- the element from which the type was obtainedtype
- the type to annotatepublic void annotate(com.sun.source.tree.Tree tree, AnnotatedTypeMirror type)
Tree
.tree
- the tree from which the type was obtainedtype
- the type to annotatepublic boolean applyUncheckedCodeDefaults(javax.lang.model.element.Element annotationScope)
public static org.checkerframework.framework.util.defaults.QualifierDefaults.BoundType getWildcardBoundType(AnnotatedTypeMirror.AnnotatedWildcardType annotatedWildcard, AnnotatedTypeFactory typeFactory)