Package org.apache.jackrabbit.oak.query
Class QueryValidator
java.lang.Object
org.apache.jackrabbit.oak.query.QueryValidator
A validator for query. Invalid queries either log a warning, or throw an
exception when trying to execute.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkStatement
(String statement) Check if a query is valid.getJson()
Get the current set of pattern data.void
void
setPattern
(String key, String pattern, String comment, boolean failQuery) Add a pattern.
-
Field Details
-
QUERY_VALIDATOR
The name of the query validator node.- See Also:
-
-
Constructor Details
-
QueryValidator
public QueryValidator()
-
-
Method Details
-
setPattern
Add a pattern.- Parameters:
key
- the keypattern
- the pattern regular expression - if empty, the entry is removedcomment
- the commentfailQuery
- - 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
Get the current set of pattern data.- Returns:
- the json representation
-
checkStatement
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
-