public final class ShapeBuilder extends Object
Shape of one analysis (plan 09, slice 1b) from the live recorder and catalog, on the analysis
thread: when the analysis freezes (freeze(gudusoft.gsqlparser.dlineage.dataflow.model.SqllrObservations, java.lang.Object)) it copies every member the producer reads, records the
traversals its visitors replay and makes the mirrors; when the analysis has finished and before it is disposed
(complete()) it takes the text renderings and seals the shape. It then drops every live object.
It calls each copied getter once per object, never a getter that creates what it returns (the field is read and
a detached empty list stands in, as the getter would have made), never toString() before
complete(). A getter that throws is recorded and throws the same kind of exception when the mirror's getter
is called.
Internal API of the SQL-LR producer.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ShapeBuilder.Call
A copied getter call.
|
| Modifier and Type | Method and Description |
|---|---|
Shape |
complete()
Takes the text renderings, after the analysis has finished and before it is disposed (when the producer took
them before slice 1b), seals the shape and drops every live object.
|
Shape |
complete(boolean keepLive)
complete(); with keepLive the live objects stay until release() (tests compare the
mirrors with them). |
static ShapeBuilder |
freeze(SqllrObservations recorder,
Object catalog)
Projects what the producer reads, when the analysis freezes.
|
ShapeObject |
mirrorOf(Object live)
The mirror of a projected live object, until
release(); null when it was not projected. |
static Shape |
project(TCustomSqlStatement statement)
The completed shape of one statement the producer parses itself (a catalog relation's definition): projected,
rendered and released at once, as nothing analyses it.
|
static ShapeBuilder |
projectKeepingLive(TCustomSqlStatement statement)
project(gudusoft.gsqlparser.TCustomSqlStatement), keeping the live objects: a caller holding the live tree finds the mirrors of its nodes with
mirrorOf(java.lang.Object). |
void |
release()
Drops every live object.
|
Shape |
shape()
The shape made at the freeze (renderings come with
complete()). |
public static ShapeBuilder freeze(SqllrObservations recorder, Object catalog)
recorder is the live
SqllrObservations; catalog the live TSQLEnv the producer reads, or null.public static Shape project(TCustomSqlStatement statement)
public static ShapeBuilder projectKeepingLive(TCustomSqlStatement statement)
project(gudusoft.gsqlparser.TCustomSqlStatement), keeping the live objects: a caller holding the live tree finds the mirrors of its nodes with
mirrorOf(java.lang.Object).public ShapeObject mirrorOf(Object live)
release(); null when it was not projected.public Shape complete()
public Shape complete(boolean keepLive)
complete(); with keepLive the live objects stay until release() (tests compare the
mirrors with them).public void release()
public Shape shape()
complete()).