- All Implemented Interfaces:
EventListener
,ParseListener
ParseListener
.
Use this to stay compatible with future API changes (i.e. added methods to
ParseListener
)
- Author:
- Lukas Eder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAttempt to parse aCondition
expression.void
parseEnd
(ParseContext ctx) Callback method invoked after the parser successfully completes parsing a SQL string.Field<?>
parseField
(ParseContext ctx) Attempt to parse aField
expression.void
parseStart
(ParseContext ctx) Callback method invoked before the parser starts parsing a SQL string.Table<?>
parseTable
(ParseContext ctx) Attempt to parse aTable
expression.
-
Constructor Details
-
DefaultParseListener
public DefaultParseListener()
-
-
Method Details
-
parseStart
Description copied from interface:ParseListener
Callback method invoked before the parser starts parsing a SQL string.Use this to perform quick modifications to the SQL string where necessary, e.g. by removing unsupported (but irrelevant) syntax from the input string of
ParseContext.characters()
.- Specified by:
parseStart
in interfaceParseListener
-
parseEnd
Description copied from interface:ParseListener
Callback method invoked after the parser successfully completes parsing a SQL string.Use this to clean up resources or perform post-parsing validations.
- Specified by:
parseEnd
in interfaceParseListener
-
parseField
Description copied from interface:ParseListener
Attempt to parse aField
expression.This parses a "term", meaning the callback does not interfere with any operators or operator precedence, but will be called only when a field term can appear. For example, with input SQL like
A + B
, the callback is called at the positions ofA
andB
. Client code does not have to (and should not) handle the+
operator, or its precedence.- Specified by:
parseField
in interfaceParseListener
- Returns:
- The
Field
expression if a field could be parsed, ornull
otherwise.
-
parseTable
Description copied from interface:ParseListener
Attempt to parse aTable
expression.This parses a "table factor", meaning the callback does not interfere with any operators or operator precedence, but will be called only when a condition term can appear. For example, with input SQL like
A join B
, the callback is called at the positions ofA
andB
. Client code does not have to (and should not) handle thejoin
operator, or its precedence.- Specified by:
parseTable
in interfaceParseListener
- Returns:
- The
Table
expression if a table could be parsed, ornull
otherwise.
-
parseCondition
Description copied from interface:ParseListener
Attempt to parse aCondition
expression.This parses a "predicate", meaning the callback does not interfere with any operators or operator precedence, but will be called only when a condition term can appear. For example, with input SQL like
A or B
, the callback is called at the positions ofA
andB
. Client code does not have to (and should not) handle theor
operator, or its precedence.- Specified by:
parseCondition
in interfaceParseListener
- Returns:
- The
Condition
expression if a condition could be parsed, ornull
otherwise.
-