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, io.github.jdbcx.VariableTag tag, Properties vars) static ParsedQueryparse(String query, io.github.jdbcx.VariableTag tag, Properties vars, io.github.jdbcx.ConfigManager config) Parses the given query string.Splits the query into zero or more groups separated by^--;; <comments>$.
-
Method Details
-
newPart
-
split
Splits the query into zero or more groups separated by^--;; <comments>$.- Parameters:
query- the original query- Returns:
- non-null list of query groups
-
parse
-
parse
public static ParsedQuery parse(String query, io.github.jdbcx.VariableTag tag, Properties vars, io.github.jdbcx.ConfigManager config) Parses the given query string.- Parameters:
query- the query string to parsetag- non-null variable tag used for parsingvars- optional variables for substitutionconfig- optional configuration manager- Returns:
- non-null parsed query
-