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 Summary
FieldsModifier and TypeFieldDescriptionfinal com.github.javaparser.ast.body.VariableDeclaratorWrapped field declaration. -
Constructor Summary
ConstructorsConstructorDescriptionFieldAnnos(com.github.javaparser.ast.body.VariableDeclarator declaration) Creates a wrapper for the given field declaration. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddDeclarationAnnotation(AnnotationMirror annotation) Adds a declaration annotation to this field declaration and returns whether it was a new annotation.deepCopy()Returns the inferred declaration annotations on this field, or an empty set if there are no annotations.getType(AnnotatedTypeMirror type, AnnotatedTypeFactory atf) Returns the inferred type of the field.toString()voidTransfers all annotations inferred by whole program inference on this field to the JavaParser nodes for that field.
-
Field Details
-
declaration
public final com.github.javaparser.ast.body.VariableDeclarator declarationWrapped 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:
deepCopyin interfaceorg.plumelib.util.DeepCopyable<WholeProgramInferenceJavaParserStorage.FieldAnnos>
-
getType
Returns the inferred type of the field. If necessary, initializes theAnnotatedTypeMirrorfor that location usingtypeandatfto a wrapper around the base type for the field.- Parameters:
type- base type for the field, used for initializing the returnedAnnotatedTypeMirrorthe first time it's accessedatf- the annotated type factory of a given type system, whose type hierarchy will be used- Returns:
- an
AnnotatedTypeMirrorcontaining all annotations inferred for the field
-
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
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
annotationwasn'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
-