Package io.github.jdbcx.driver
Class QueryParser
java.lang.Object
io.github.jdbcx.driver.QueryParser
This class parses the given query string to extract discrete parts and
executable code blocks. It can only recognize function(with a return value,
usually string) "{{[-] [func[(key=value)]:] <...> }}" or
procedure(void function) "{%[-] [proc[(key=value)]:] <...> %}". Block
starts with "{{-" or "{%-"" will be skipped and replaced with empty string.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic QueryParser.Partstatic ParsedQueryparse(String query, Properties vars) Parses the given query string.static ParsedQueryparse(String query, Properties vars, char escapeChar) Parses the given query string to extract discrete parts and executable code blocks.
-
Method Details
-
newPart
-
parse
Parses the given query string. Same asparse(query, vars, '\\').- Parameters:
query- the query string to parsevars- optional variables for substitution- Returns:
- non-null parsed query
-
parse
Parses the given query string to extract discrete parts and executable code blocks.- Parameters:
query- the query string to parsevars- optional variables for substitutionescapeChar- the escape character, typically backslash - cannot be percent (%) or brace ({})- Returns:
- non-null parsed query
-