Record Class WholeProgramInferenceJavaParserStorage.CompilationUnitAnnos

java.lang.Object
java.lang.Record
org.checkerframework.common.wholeprograminference.WholeProgramInferenceJavaParserStorage.CompilationUnitAnnos
Record Components:
compilationUnit - compilation unit being wrapped
types - wrappers for classes and interfaces in compilationUnit
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 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 a CompilationUnitAnnos record class.
      Parameters:
      compilationUnit - the value for the compilationUnit record component
      types - the value for the types record component
  • Method Details

    • deepCopy

      Specified by:
      deepCopy in interface org.plumelib.util.DeepCopyable<WholeProgramInferenceJavaParserStorage.CompilationUnitAnnos>
    • transferAnnotations

      public void transferAnnotations(BaseTypeChecker checker)
      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 named name in the compilation unit.
      Parameters:
      name - name of type declaration
      Returns:
      the type declaration named name in the wrapped compilation unit
    • toStringVerbose

      public String toStringVerbose()
      Returns a verbose printed representation of this.
      Returns:
      a verbose printed representation of this
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • compilationUnit

      public com.github.javaparser.ast.CompilationUnit compilationUnit()
      Returns the value of the compilationUnit record component.
      Returns:
      the value of the compilationUnit record component
    • types

      Returns the value of the types record component.
      Returns:
      the value of the types record component