public final class StatementSourceView extends Object
SourceSpan coordinates tied to
the same original SQL text.
GSP spans use global, 1-based line/column coordinates, while
AnalysisResult.getStatementText() is trimmed and has one trailing
semicolon removed. Consumers should therefore use slice(SourceSpan)
instead of applying a global span directly to the per-statement string.
| Modifier and Type | Method and Description |
|---|---|
String |
getFullSql() |
long |
getStatementStartColumn() |
long |
getStatementStartLine() |
long |
getStatementStartOffset() |
String |
getStatementText()
Return the analyzer-compatible statement text: surrounding whitespace
and one trailing statement separator are removed.
|
static StatementSourceView |
of(String fullSql,
TCustomSqlStatement statement)
Build a view from the original input and one parsed statement.
|
Optional<String> |
slice(SourceSpan span)
Slice a global half-open span from the original SQL text.
|
public static StatementSourceView of(String fullSql, TCustomSqlStatement statement)
public String getFullSql()
public String getStatementText()
public long getStatementStartOffset()
-1 when tokens lack one.public long getStatementStartLine()
-1 when unavailable.public long getStatementStartColumn()
-1 when unavailable.public Optional<String> slice(SourceSpan span)