java.lang.Object
org.firebirdsql.jaybird.parser.StatementDetector
- All Implemented Interfaces:
TokenVisitor
Detects the type of statement, and - optionally - whether a DML statement has a
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.
- Since:
- 5
- Author:
- Mark Rotteveel
-
Constructor Summary
ConstructorsConstructorDescriptionDetect statement type and returning clause.StatementDetector(boolean detectReturning) Detect statement type and - optionally - returning clause. -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete(VisitorRegistrar visitorRegistrar) Signals that the last token was produced and the statement text was fully parsed.static LocalStatementTypeDetermines the local statement type ofsql.voidvisitToken(Token token, VisitorRegistrar visitorRegistrar) Notifies the visitor of a token.
-
Constructor Details
-
StatementDetector
public StatementDetector()Detect statement type and returning clause.- See Also:
-
StatementDetector
public StatementDetector(boolean detectReturning) Detect statement type and - optionally - returning clause.- Parameters:
detectReturning-truedetect returning clause,falsedo not detect returning clause
-
-
Method Details
-
determineLocalStatementType
Determines the local statement type ofsql.The return values of this method are decided by the needs of Jaybird, and do not necessarily cover all statement types, and they may change between point releases.
- Parameters:
sql- statement text- Returns:
- local statement type
- Since:
- 6
-
visitToken
Description copied from interface:TokenVisitorNotifies the visitor of a token.- Specified by:
visitTokenin interfaceTokenVisitor- Parameters:
token- TokenvisitorRegistrar- Visitor registrar (can be used to remove itself, or add other visitors)
-
complete
Description copied from interface:TokenVisitorSignals that the last token was produced and the statement text was fully parsed.- Specified by:
completein interfaceTokenVisitor- Parameters:
visitorRegistrar- Visitor registrar (can be used to remove itself, or add other visitors)
-
toStatementIdentification
-
getStatementType
- Returns:
- detected statement type,
UNKNOWNwhen no tokens have been received (nothing was parsed)
-