Package org.firebirdsql.jaybird.parser
Class StatementDetector
- java.lang.Object
- 
- org.firebirdsql.jaybird.parser.StatementDetector
 
- 
- All Implemented Interfaces:
- TokenVisitor
 
 @InternalApi public final class StatementDetector extends java.lang.Object implements TokenVisitor Detects the type of statement, and - optionally - whether a DML statement has aRETURNINGclause.If the detected statement type is UPDATE,DELETE,INSERT,UPDATE OR INSERTandMERGE, it identifies the affected table and - optionally - whether or not aRETURNINGclause is present (delegated to aReturningClauseDetector).The types of statements detected are informed by the needs of Jaybird, and may change between point releases. - Since:
- 5
- Author:
- Mark Rotteveel
 
- 
- 
Constructor SummaryConstructors Constructor Description StatementDetector()Detect statement type and returning clause.StatementDetector(boolean detectReturning)Detect statement type and - optionally - returning clause.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete(VisitorRegistrar visitorRegistrar)Signals that the last token was produced and the statement text was fully parsed.LocalStatementTypegetStatementType()StatementIdentificationtoStatementIdentification()voidvisitToken(Token token, VisitorRegistrar visitorRegistrar)Notifies the visitor of a token.
 
- 
- 
- 
Constructor Detail- 
StatementDetectorpublic StatementDetector() Detect statement type and returning clause.- See Also:
- StatementDetector(boolean)
 
 - 
StatementDetectorpublic StatementDetector(boolean detectReturning) Detect statement type and - optionally - returning clause.- Parameters:
- detectReturning-- truedetect returning clause,- falsedo not detect returning clause
 
 
- 
 - 
Method Detail- 
visitTokenpublic void visitToken(Token token, VisitorRegistrar visitorRegistrar) Description copied from interface:TokenVisitorNotifies the visitor of a token.- Specified by:
- visitTokenin interface- TokenVisitor
- Parameters:
- token- Token
- visitorRegistrar- Visitor registrar (can be used to remove itself, or add other visitors)
 
 - 
completepublic void complete(VisitorRegistrar visitorRegistrar) Description copied from interface:TokenVisitorSignals that the last token was produced and the statement text was fully parsed.- Specified by:
- completein interface- TokenVisitor
- Parameters:
- visitorRegistrar- Visitor registrar (can be used to remove itself, or add other visitors)
 
 - 
toStatementIdentificationpublic StatementIdentification toStatementIdentification() 
 - 
getStatementTypepublic LocalStatementType getStatementType() - Returns:
- detected statement type, UNKNOWNwhen no tokens have been received (nothing was parsed)
 
 
- 
 
-