public final class AnalysisResult extends Object
SqlSemanticAnalyzer.analyze(java.lang.String, gudusoft.gsqlparser.EDbVendor) call. Carries the
built SemanticProgram, the JSON-encoded form, and the list
of Diagnostics emitted during analysis.
A successful analysis produces a non-null program and JSON with
an empty (or warning-only) diagnostics list. A failed analysis
produces a null program / JSON and at least one
ERROR-severity diagnostic.
This type is immutable and thread-safe. Consumers should
pattern-match on Diagnostic.getCode() (the
DiagnosticCode enum is the stable contract) rather than
parsing message text.
| Modifier and Type | Method and Description |
|---|---|
List<Diagnostic> |
getDiagnostics()
Diagnostics emitted during analysis.
|
Diagnostic |
getFirstError() |
String |
getJson() |
SemanticProgram |
getProgram() |
String |
getSchemaVersion()
JSON schema version emitted by the analyzer (currently
"1"). |
boolean |
isSuccessful() |
public boolean isSuccessful()
true iff a non-null program was built AND no
ERROR-severity diagnostics are
present.public String getSchemaVersion()
"1").public SemanticProgram getProgram()
null when analysis
failed. Use isSuccessful() as the discriminator.public String getJson()
getProgram(), or
null when analysis failed.public List<Diagnostic> getDiagnostics()
null; may be empty.public Diagnostic getFirstError()
ERROR-severity
diagnostic, or null when none were emitted.