Class JavacParseResult<T extends Tree>

java.lang.Object
org.checkerframework.javacutil.javacparse.JavacParseResult<T>
Type Parameters:
T - the type of the Java code being parsed

public final class JavacParseResult<T extends Tree> extends Object
Represents the result of parsing Java code (a file or a subpart thereof).
  • Constructor Details

    • JavacParseResult

      public JavacParseResult(T tree, List<Diagnostic<? extends JavaFileObject>> diagnostics)
      Create a JavacParseResult.
      Parameters:
      tree - the parse tree
      diagnostics - the diagnostics
  • Method Details

    • getTree

      public final T getTree()
      Returns the parse tree.
      Returns:
      the parse tree
    • getDiagnostics

      public final List<Diagnostic<? extends JavaFileObject>> getDiagnostics()
      Returns the diagnostics.
      Returns:
      the diagnostics
    • hasParseError

      public final boolean hasParseError()
      Returns true if at least one diagnostic is a parse error.
      Returns:
      true if at least one diagnostic is a parse error
    • getParseErrorMessages

      public final String getParseErrorMessages()
      Returns all the parse error messages, concatenated. May return an empty string.
      Returns:
      all the parse error messages, concatenated
    • toString

      public String toString(@GuardSatisfied JavacParseResult<T extends Tree> this)
      Overrides:
      toString in class Object