@InternalApi public final class StatementDetector extends java.lang.Object implements TokenVisitor
RETURNING
clause.
If the detected statement type is UPDATE
, DELETE
, INSERT
, UPDATE OR INSERT
and
MERGE
, it identifies the affected table and - optionally - whether or not a RETURNING
clause is
present (delegated to a ReturningClauseDetector
).
The types of statements detected are informed by the needs of Jaybird, and may change between point releases.
Constructor and Description |
---|
StatementDetector()
Detect statement type and returning clause.
|
StatementDetector(boolean detectReturning)
Detect statement type and - optionally - returning clause.
|
Modifier and Type | Method and Description |
---|---|
void |
complete(VisitorRegistrar visitorRegistrar)
Signals that the last token was produced and the statement text was fully parsed.
|
LocalStatementType |
getStatementType() |
StatementIdentification |
toStatementIdentification() |
void |
visitToken(Token token,
VisitorRegistrar visitorRegistrar)
Notifies the visitor of a token.
|
public StatementDetector()
StatementDetector(boolean)
public StatementDetector(boolean detectReturning)
detectReturning
- true
detect returning clause, false
do not detect returning clausepublic void visitToken(Token token, VisitorRegistrar visitorRegistrar)
TokenVisitor
visitToken
in interface TokenVisitor
token
- TokenvisitorRegistrar
- Visitor registrar (can be used to remove itself, or add other visitors)public void complete(VisitorRegistrar visitorRegistrar)
TokenVisitor
complete
in interface TokenVisitor
visitorRegistrar
- Visitor registrar (can be used to remove itself, or add other visitors)public StatementIdentification toStatementIdentification()
public LocalStatementType getStatementType()
UNKNOWN
when no tokens have been received (nothing was parsed)Copyright © 2001-2022 Jaybird (Firebird JDBC/JCA) team. All rights reserved.