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.
  • 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