Class AnnotationConverter

java.lang.Object
org.checkerframework.common.wholeprograminference.AnnotationConverter

public class AnnotationConverter extends Object
This class contains static methods that convert between Annotation and AnnotationMirror.
  • Method Details

    • annotationMirrorToAnnotation

      public static org.checkerframework.afu.scenelib.Annotation annotationMirrorToAnnotation(AnnotationMirror am)
      Converts an AnnotationMirror into an Annotation.
      Parameters:
      am - the AnnotationMirror
      Returns:
      the Annotation
    • annotationToAnnotationMirror

      protected static AnnotationMirror annotationToAnnotationMirror(org.checkerframework.afu.scenelib.Annotation anno, ProcessingEnvironment processingEnv)
      Converts an Annotation into an AnnotationMirror.
      Parameters:
      anno - the Annotation
      processingEnv - the ProcessingEnvironment
      Returns:
      the AnnotationMirror
    • getAnnotationFieldType

      protected static @Nullable org.checkerframework.afu.scenelib.field.AnnotationFieldType getAnnotationFieldType(ExecutableElement ee)
      Returns the type of an element (that is, a field) of an annotation.
      Parameters:
      ee - an element (that is, a field) of an annotation
      Returns:
      the type of the given annotation field
    • typeMirrorToAnnotationFieldType

      protected static org.checkerframework.afu.scenelib.field.AnnotationFieldType typeMirrorToAnnotationFieldType(TypeMirror tm)
      Converts a TypeMirror to an AnnotationFieldType.
      Parameters:
      tm - a type for an annotation element/field: primitive, String, class, enum constant, or array thereof
      Returns:
      an AnnotationFieldType corresponding to the argument
    • addFieldToAnnotationBuilder

      protected static void addFieldToAnnotationBuilder(String fieldKey, Object obj, AnnotationBuilder builder)
      Adds a field to an AnnotationBuilder.
      Parameters:
      fieldKey - is the name of the field
      obj - is the value of the field
      builder - is the AnnotationBuilder