Class QueryValidator

java.lang.Object
org.apache.jackrabbit.oak.query.QueryValidator

public class QueryValidator extends Object
A validator for query. Invalid queries either log a warning, or throw an exception when trying to execute.
  • Field Details

  • Constructor Details

    • QueryValidator

      public QueryValidator()
  • Method Details

    • setPattern

      public void setPattern(String key, String pattern, String comment, boolean failQuery)
      Add a pattern.
      Parameters:
      key - the key
      pattern - the pattern regular expression - if empty, the entry is removed
      comment - the comment
      failQuery - - if true, trying to run such a query will fail; otherwise the queries that will work, but will log a warning. A warning is logged at most once every 10 seconds.
    • getJson

      public String getJson()
      Get the current set of pattern data.
      Returns:
      the json representation
    • checkStatement

      public void checkStatement(String statement) throws ParseException
      Check if a query is valid. It is either valid, logs a warning, or throws a exception if invalid.
      Parameters:
      statement - the query statement
      Throws:
      ParseException - if it is invalid
    • init

      public void init(NodeStore store)