Package io.github.jdbcx.driver

# Class QueryParser

java.lang.Object
io.github.jdbcx.driver.QueryParser

public final class QueryParser extends Object
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
Modifier and Type
Class
Description
`static final class`
`QueryParser.Part`

## Method Summary

Modifier and Type
Method
Description
`static QueryParser.Part`
`newPart(int endPosition, String escapedString)`
`static ParsedQuery`
`parse(String query, VariableTag tag, Properties vars)`
Parses the given query string.
`static List<String[]>`
`split(String query)`
Splits the query into zero or more groups separated by `^--;; <comments>$`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### newPart

public static QueryParser.Part newPart(int endPosition, String escapedString)

### split

public static List<String[]> split(String query)
Splits the query into zero or more groups separated by `^--;; <comments>$`.

Parameters:
  `query` - the original query
Returns:
  non-null list of query groups

### parse

public static ParsedQuery parse(String query, VariableTag tag, Properties vars)
Parses the given query string.

Parameters:
  `query` - the query string to parse
  `tag` - non-null variable tag used for parsing
  `vars` - optional variables for substitution
Returns:
  non-null parsed query