public final class UnresolvedFragment extends Object
DynamicSqlSite.getUnresolvedFragments() so a consumer can say WHICH
value stopped the rebuild and where that value comes from, rather than only
that the site was not rebuilt.
getName() is the variable / parameter / function the hole stands
for (@Where, @HuidigOutboundRunID, CAST); it is null
only when the producer had no name. getText() is how the hole is
rendered inside DynamicSqlSite.getMaterializedText().
getValueOrigin() describes the data source the runtime value would be
read from when the evaluator saw it — dbo.SSF_Entity.Entity for a
variable assigned by SELECT @entity = Entity FROM dbo.SSF_Entity.
The span is the fragment's origin in the analyzed text — the
assignment target of a query-assigned or flow-dependent variable, the
declaration of an unbound parameter or of a declared-but-unassigned
variable, otherwise the reference that produced the hole — so a consumer can
highlight it with the same locate-in-source control it uses for the site.
Positions are 1-based with an end-exclusive end column, the convention of
DynamicSqlSite.getStartPosition(); -1 when the origin is not
in the analyzed text.
| Constructor and Description |
|---|
UnresolvedFragment(SqlFragment.HoleOrigin kind,
String name,
String text,
String reason,
boolean valueUnknown,
String valueOrigin,
int startLine,
int startColumn,
int endLine,
int endColumn) |
| Modifier and Type | Method and Description |
|---|---|
int |
getEndColumn()
End-exclusive.
|
int |
getEndLine() |
SqlFragment.HoleOrigin |
getKind()
Why the hole exists: which producer limitation created it.
|
String |
getName()
The variable / parameter / function / expression the hole stands for; may be null.
|
String |
getReason()
Human-readable cause: why the value was not folded.
|
int |
getStartColumn() |
int |
getStartLine() |
String |
getText()
The hole's rendering inside
DynamicSqlSite.getMaterializedText(). |
String |
getValueOrigin()
Where the runtime value would come from, when known; otherwise null.
|
boolean |
hasSpan()
True when the origin span is known.
|
boolean |
isValueUnknown()
True when the runtime VALUE is unknown; false for an inexact transform computed
entirely from literals, whose value is known and only its byte-exact rendering is
unproven (see
SqlFragment.valueUnknown). |
static UnresolvedFragment |
of(SqlFragment fragment)
The fragment view of a non-literal
SqlFragment; null for a literal. |
String |
toString() |
public UnresolvedFragment(SqlFragment.HoleOrigin kind, String name, String text, String reason, boolean valueUnknown, String valueOrigin, int startLine, int startColumn, int endLine, int endColumn)
public static UnresolvedFragment of(SqlFragment fragment)
SqlFragment; null for a literal.public SqlFragment.HoleOrigin getKind()
public String getName()
public String getText()
DynamicSqlSite.getMaterializedText(). Never null.public boolean isValueUnknown()
SqlFragment.valueUnknown).public String getValueOrigin()
public int getStartLine()
public int getStartColumn()
public int getEndLine()
public int getEndColumn()
public boolean hasSpan()