Class WholeProgramInferenceJavaParserStorage.FieldAnnos

java.lang.Object
org.checkerframework.common.wholeprograminference.WholeProgramInferenceJavaParserStorage.FieldAnnos
All Implemented Interfaces:
org.plumelib.util.DeepCopyable<WholeProgramInferenceJavaParserStorage.FieldAnnos>
Enclosing class:
WholeProgramInferenceJavaParserStorage

public static class WholeProgramInferenceJavaParserStorage.FieldAnnos extends Object implements org.plumelib.util.DeepCopyable<WholeProgramInferenceJavaParserStorage.FieldAnnos>
Stores the JavaParser node for a field and the annotations that have been inferred for it.
  • Field Details

    • declaration

      public final com.github.javaparser.ast.body.VariableDeclarator declaration
      Wrapped field declaration.
  • Constructor Details

    • FieldAnnos

      public FieldAnnos(com.github.javaparser.ast.body.VariableDeclarator declaration)
      Creates a wrapper for the given field declaration.
      Parameters:
      declaration - field declaration to wrap
  • Method Details

    • deepCopy

      Specified by:
      deepCopy in interface org.plumelib.util.DeepCopyable<WholeProgramInferenceJavaParserStorage.FieldAnnos>
    • getType

      Returns the inferred type of the field. If necessary, initializes the AnnotatedTypeMirror for that location using type and atf to a wrapper around the base type for the field.
      Parameters:
      type - base type for the field, used for initializing the returned AnnotatedTypeMirror the first time it's accessed
      atf - the annotated type factory of a given type system, whose type hierarchy will be used
      Returns:
      an AnnotatedTypeMirror containing all annotations inferred for the field
    • getDeclarationAnnotations

      public AnnotationMirrorSet getDeclarationAnnotations()
      Returns the inferred declaration annotations on this field, or an empty set if there are no annotations.
      Returns:
      the declaration annotations for this field declaration
    • addDeclarationAnnotation

      public boolean addDeclarationAnnotation(AnnotationMirror annotation)
      Adds a declaration annotation to this field declaration and returns whether it was a new annotation.
      Parameters:
      annotation - declaration annotation to add
      Returns:
      true if annotation wasn't previously stored for this field declaration
    • transferAnnotations

      public void transferAnnotations()
      Transfers all annotations inferred by whole program inference on this field to the JavaParser nodes for that field.
    • toString

      public String toString()
      Overrides:
      toString in class Object