Record Class WholeProgramInferenceJavaParserStorage.CompilationUnitAnnos
java.lang.Object
java.lang.Record
org.checkerframework.common.wholeprograminference.WholeProgramInferenceJavaParserStorage.CompilationUnitAnnos
- Record Components:
compilationUnit- compilation unit being wrappedtypes- wrappers for classes and interfaces incompilationUnit
- All Implemented Interfaces:
org.plumelib.util.DeepCopyable<WholeProgramInferenceJavaParserStorage.CompilationUnitAnnos>
- Enclosing class:
WholeProgramInferenceJavaParserStorage
public static record WholeProgramInferenceJavaParserStorage.CompilationUnitAnnos(com.github.javaparser.ast.CompilationUnit compilationUnit, List<WholeProgramInferenceJavaParserStorage.ClassOrInterfaceAnnos> types)
extends Record
implements org.plumelib.util.DeepCopyable<WholeProgramInferenceJavaParserStorage.CompilationUnitAnnos>
Stores the JavaParser node for a compilation unit and the list of wrappers for the classes and
interfaces in that compilation unit.
-
Constructor Summary
ConstructorsConstructorDescriptionCompilationUnitAnnos(com.github.javaparser.ast.CompilationUnit compilationUnit) Constructs a wrapper around the given compilation unit.CompilationUnitAnnos(com.github.javaparser.ast.CompilationUnit compilationUnit, List<WholeProgramInferenceJavaParserStorage.ClassOrInterfaceAnnos> types) Creates an instance of aCompilationUnitAnnosrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.github.javaparser.ast.CompilationUnitReturns the value of thecompilationUnitrecord component.deepCopy()final booleanIndicates whether some other object is "equal to" this one.com.github.javaparser.ast.body.TypeDeclaration<?> Returns the top-level type declaration namednamein the compilation unit.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns a verbose printed representation of this.voidtransferAnnotations(BaseTypeChecker checker) Transfers all annotations inferred by whole program inference for the wrapped compilation unit to their corresponding JavaParser locations.types()Returns the value of thetypesrecord component.
-
Constructor Details
-
CompilationUnitAnnos
public CompilationUnitAnnos(com.github.javaparser.ast.CompilationUnit compilationUnit) Constructs a wrapper around the given compilation unit.- Parameters:
compilationUnit- compilation unit to wrap
-
CompilationUnitAnnos
public CompilationUnitAnnos(com.github.javaparser.ast.CompilationUnit compilationUnit, List<WholeProgramInferenceJavaParserStorage.ClassOrInterfaceAnnos> types) Creates an instance of aCompilationUnitAnnosrecord class.- Parameters:
compilationUnit- the value for thecompilationUnitrecord componenttypes- the value for thetypesrecord component
-
-
Method Details
-
deepCopy
- Specified by:
deepCopyin interfaceorg.plumelib.util.DeepCopyable<WholeProgramInferenceJavaParserStorage.CompilationUnitAnnos>
-
transferAnnotations
Transfers all annotations inferred by whole program inference for the wrapped compilation unit to their corresponding JavaParser locations.- Parameters:
checker- the checker who's name to include in the @AnnotatedFor annotation
-
getClassOrInterfaceDeclarationByName
public com.github.javaparser.ast.body.TypeDeclaration<?> getClassOrInterfaceDeclarationByName(String name) Returns the top-level type declaration namednamein the compilation unit.- Parameters:
name- name of type declaration- Returns:
- the type declaration named
namein the wrapped compilation unit
-
toStringVerbose
Returns a verbose printed representation of this.- Returns:
- a verbose printed representation of this
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
compilationUnit
public com.github.javaparser.ast.CompilationUnit compilationUnit()Returns the value of thecompilationUnitrecord component.- Returns:
- the value of the
compilationUnitrecord component
-
types
Returns the value of thetypesrecord component.- Returns:
- the value of the
typesrecord component
-