Package org.plumelib.javacparse
Record Class JavacParseResult<T extends Tree>
java.lang.Object
java.lang.Record
org.plumelib.javacparse.JavacParseResult<T>
- Type Parameters:
T- the type of the Java code being parsed- Record Components:
tree- the parse treediagnostics- the diagnostics
public record JavacParseResult<T extends Tree>(T extends Tree tree, List<Diagnostic<? extends JavaFileObject>> diagnostics)
extends Record
Represents the result of parsing Java code (a file or a subpart thereof).
-
Constructor Summary
ConstructorsConstructorDescriptionJavacParseResult(T tree, List<Diagnostic<? extends JavaFileObject>> diagnostics) Creates an instance of aJavacParseResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<Diagnostic<? extends JavaFileObject>>Returns the value of thediagnosticsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns all the parse error messages, concatenated.final inthashCode()Returns a hash code value for this object.booleanReturns true if at least one diagnostic is a parse error.toString()Returns a string representation of this record class.tree()Returns the value of thetreerecord component.
-
Constructor Details
-
JavacParseResult
Creates an instance of aJavacParseResultrecord class.- Parameters:
tree- the value for thetreerecord componentdiagnostics- the value for thediagnosticsrecord component
-
-
Method Details
-
hasParseError
public 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
Returns all the parse error messages, concatenated. May return an empty string.- Returns:
- all the parse error messages, concatenated
-
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). -
tree
Returns the value of thetreerecord component.- Returns:
- the value of the
treerecord component
-
diagnostics
Returns the value of thediagnosticsrecord component.- Returns:
- the value of the
diagnosticsrecord component
-