Class SimpleSearchQueryParser
java.lang.Object
com.atlassian.confluence.macro.query.SimpleSearchQueryParser
Parses
Strings into SearchQuery implementations
according to the SearchQueryInterpreter provided at construction
time and returns a BooleanQueryFactory.
Strings are split into tokens separated by commas or whitespace. They
are inserted into a BooleanQueryFactory based on the token
preceding them, which are InclusionCriteria implementations.
- Since:
- 2.9
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleSearchQueryParser(SearchQueryInterpreter interpreter) Constructs a new parser using the specifiedSearchQueryInterpreterto transform string tokens intoSearchQueryimplementations.SimpleSearchQueryParser(SearchQueryInterpreter interpreter, InclusionCriteria defaultInclusionCriteria) Constructs a new parser using the specifiedSearchQueryInterpreterto transform string tokens intoSearchQueryimplementations and using the specifiedInclusionCriteriaas the default criteria for untagged tokens. -
Method Summary
Modifier and TypeMethodDescriptionParses the specifiedStringinto aBooleanQueryFactoryimplementation according to the rules specified by theSearchQueryInterpreter.voidsetDefaultInclusionCriteria(InclusionCriteria criteria) Sets whichInclusionCriteriashould be applied to a value in the absence of a specific token.
-
Constructor Details
-
SimpleSearchQueryParser
Constructs a new parser using the specifiedSearchQueryInterpreterto transform string tokens intoSearchQueryimplementations. The defaultInclusionCriteriais ANY.- Parameters:
interpreter- theSearchQueryInterpreterimplementation to use
-
SimpleSearchQueryParser
public SimpleSearchQueryParser(SearchQueryInterpreter interpreter, InclusionCriteria defaultInclusionCriteria) Constructs a new parser using the specifiedSearchQueryInterpreterto transform string tokens intoSearchQueryimplementations and using the specifiedInclusionCriteriaas the default criteria for untagged tokens.- Parameters:
interpreter- theSearchQueryInterpreterimplementation to usedefaultInclusionCriteria- the defaultInclusionCriteriafor untagged tokens
-
-
Method Details
-
setDefaultInclusionCriteria
Sets whichInclusionCriteriashould be applied to a value in the absence of a specific token.- Parameters:
criteria- the defaultInclusionCriteriavalue to use
-
parse
Parses the specifiedStringinto aBooleanQueryFactoryimplementation according to the rules specified by theSearchQueryInterpreter.- Parameters:
query- theStringto parse- Returns:
- a
BooleanQueryFactorycorresponding to the String - Throws:
SearchQueryParserException- if an error occurs during parsing
-