Package org.firebirdsql.jaybird.parser
Class SqlParser
- java.lang.Object
- 
- org.firebirdsql.jaybird.parser.SqlParser
 
- 
- All Implemented Interfaces:
- VisitorRegistrar
 
 @InternalApi public final class SqlParser extends java.lang.Object implements VisitorRegistrar Simple visiting SQL parser.This parser is not thread-safe. - Since:
- 5
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSqlParser.Builder
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlParseradd(TokenVisitor tokenVisitor)Fluent variant ofaddVisitor(TokenVisitor).voidaddVisitor(TokenVisitor tokenVisitor)Adds a visitor.booleanisCompleted()booleanisParsing()booleanisStarted()voidparse()Starts parsing of the statement text.voidremoveVisitor(TokenVisitor tokenVisitor)Removes a visitor - if already registered.voidresumeParsing()Start or resume parsing of the statement text.static SqlParser.BuilderwithReservedWords(ReservedWords reservedWords)Creates a builder for a SQL parser with a supplier of reserved words.
 
- 
- 
- 
Method Detail- 
withReservedWordspublic static SqlParser.Builder withReservedWords(ReservedWords reservedWords) Creates a builder for a SQL parser with a supplier of reserved words.- Parameters:
- reservedWords- Reserved words
- Returns:
- builder to complete initialization of a SQL parser
 
 - 
parsepublic void parse() Starts parsing of the statement text.- Throws:
- java.lang.IllegalStateException- When- parse()has already been parsed, or there are no registered visitors.
- See Also:
- resumeParsing()
 
 - 
resumeParsingpublic void resumeParsing() Start or resume parsing of the statement text.If the parsing process previously stalled because there were no more visitors, this continues parsing at the point the parser previously stopped. If parsing was not yet started (e.g. using parse()), it will start.- Throws:
- java.lang.IllegalStateException- When parsing was already completed, parsing is already in progress, or there are no registered visitors
- See Also:
- parse()
 
 - 
isStartedpublic boolean isStarted() 
 - 
isParsingpublic boolean isParsing() 
 - 
isCompletedpublic boolean isCompleted() 
 - 
addpublic SqlParser add(TokenVisitor tokenVisitor) Fluent variant ofaddVisitor(TokenVisitor).- Parameters:
- tokenVisitor- token visitor to add
- Returns:
- this SQL parser
 
 - 
addVisitorpublic void addVisitor(TokenVisitor tokenVisitor) Description copied from interface:VisitorRegistrarAdds a visitor.- Specified by:
- addVisitorin interface- VisitorRegistrar
- Parameters:
- tokenVisitor- Token visitor
 
 - 
removeVisitorpublic void removeVisitor(TokenVisitor tokenVisitor) Description copied from interface:VisitorRegistrarRemoves a visitor - if already registered.- Specified by:
- removeVisitorin interface- VisitorRegistrar
- Parameters:
- tokenVisitor- Token visitor
 
 
- 
 
-