Class Annotations

java.lang.Object
org.checkerframework.afu.scenelib.Annotations

public abstract class Annotations extends Object
This noninstantiable class provides useful static methods related to annotations, following the convention of Collections.
  • Field Details

    • noAnnotations

      public static Set<Annotation> noAnnotations
    • noFieldTypes

      public static Map<String,? extends AnnotationFieldType> noFieldTypes
    • noFieldValues

      public static Map<String,? extends Object> noFieldValues
    • typeQualifierMetaAnnotations

      public static Set<Annotation> typeQualifierMetaAnnotations
    • aftRetentionPolicy

      public static EnumAFT aftRetentionPolicy
    • adRetention

      public static AnnotationDef adRetention
    • aRetentionClass

      public static Annotation aRetentionClass
    • aRetentionRuntime

      public static Annotation aRetentionRuntime
    • aRetentionSource

      public static Annotation aRetentionSource
    • asRetentionClass

      public static Set<Annotation> asRetentionClass
    • asRetentionRuntime

      public static Set<Annotation> asRetentionRuntime
    • asRetentionSource

      public static Set<Annotation> asRetentionSource
    • adTarget

      public static AnnotationDef adTarget
    • aTargetTypeUse

      public static Annotation aTargetTypeUse
    • onlyTypeAnnotationTargets

      public static List<Annotation> onlyTypeAnnotationTargets
    • adDocumented

      public static AnnotationDef adDocumented
    • aDocumented

      public static Annotation aDocumented
    • adNonNull

      public static AnnotationDef adNonNull
    • aNonNull

      public static Annotation aNonNull
    • standardDefs

      public static Set<AnnotationDef> 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

      public static Map<String,? extends Object> valueFieldOnly(Object valueValue)
    • createValueAnnotationDef

      public static AnnotationDef createValueAnnotationDef(@BinaryName String name, Set<Annotation> metaAnnotations, AnnotationFieldType aft, String source)
      Create an annotation definition with only a value field.
      Parameters:
      name - the name of the annotation being built
      metaAnnotations - the meta-annotations that appear on the annotation definiition
      aft - the value of the value field
      source - where the annotation came from, such as a filename
      Returns:
      a new AnnotationDef
    • createValueAnnotation

      public static Annotation createValueAnnotation(AnnotationDef ad, Object value)
    • getRetentionPolicyMetaAnnotation

      public static Annotation getRetentionPolicyMetaAnnotation(RetentionPolicy rp)
    • getRetentionPolicyMetaAnnotationSet

      public static Set<Annotation> getRetentionPolicyMetaAnnotationSet(RetentionPolicy rp)
    • rebuild

      public static final Annotation rebuild(Annotation a)
      Clones the annotation a using the factory af by iterating through its fields according to its definition and getting the values with Annotation.getFieldValue(java.lang.String). Returns null if the factory is not interested in a.
      Parameters:
      a - the annotation to clone
      Returns:
      a clone of the given annotation