Class Annotations
java.lang.Object
org.checkerframework.afu.scenelib.Annotations
This noninstantiable class provides useful static methods related to annotations, following the
convention of
Collections
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic AnnotationDef
static AnnotationDef
static Annotation
static AnnotationDef
static AnnotationDef
static EnumAFT
static Annotation
static Annotation
static Annotation
static Annotation
static Set
<Annotation> static Set
<Annotation> static Set
<Annotation> static Annotation
static Set
<Annotation> static Map
<String, ? extends AnnotationFieldType> static List
<Annotation> static Set
<AnnotationDef> Annotations that are meta-annotated with themselves.static Set
<Annotation> -
Method Summary
Modifier and TypeMethodDescriptionstatic Annotation
createValueAnnotation
(AnnotationDef ad, Object value) static AnnotationDef
createValueAnnotationDef
(@BinaryName String name, Set<Annotation> metaAnnotations, AnnotationFieldType aft, String source) Create an annotation definition with only avalue
field.static Annotation
static Set
<Annotation> static final Annotation
Clones the annotationa
using the factoryaf
by iterating through its fields according to its definition and getting the values withAnnotation.getFieldValue(java.lang.String)
.valueFieldOnly
(Object valueValue)
-
Field Details
-
noAnnotations
-
noFieldTypes
-
noFieldValues
-
typeQualifierMetaAnnotations
-
aftRetentionPolicy
-
adRetention
-
aRetentionClass
-
aRetentionRuntime
-
aRetentionSource
-
asRetentionClass
-
asRetentionRuntime
-
asRetentionSource
-
adTarget
-
aTargetTypeUse
-
onlyTypeAnnotationTargets
-
adDocumented
-
aDocumented
-
adNonNull
-
aNonNull
-
standardDefs
Annotations that are meta-annotated with themselves. Due to a flaw in the Scene Library, it is unable to read them from classfiles. An expedient workaround is to pre-define them, so they never need be read from a classfile.
-
-
Method Details
-
valueFieldOnly
-
createValueAnnotationDef
public static AnnotationDef createValueAnnotationDef(@BinaryName String name, Set<Annotation> metaAnnotations, AnnotationFieldType aft, String source) Create an annotation definition with only avalue
field.- Parameters:
name
- the name of the annotation being builtmetaAnnotations
- the meta-annotations that appear on the annotation definiitionaft
- the value of thevalue
fieldsource
- where the annotation came from, such as a filename- Returns:
- a new AnnotationDef
-
createValueAnnotation
-
getRetentionPolicyMetaAnnotation
-
getRetentionPolicyMetaAnnotationSet
-
rebuild
Clones the annotationa
using the factoryaf
by iterating through its fields according to its definition and getting the values withAnnotation.getFieldValue(java.lang.String)
. Returns null if the factory is not interested ina
.- Parameters:
a
- the annotation to clone- Returns:
- a clone of the given annotation
-