public class DocumentSelector extends Object
A document selector is a filter which accepts or rejects documents based on their type and content. A document selector has a textual representation which is called the Document Selection Language
Document selectors are multithread safe.
Modifier and Type | Field and Description |
---|---|
private ExpressionNode |
expression |
Constructor and Description |
---|
DocumentSelector(String selector)
Creates a document selector from a Document Selection Language string
|
Modifier and Type | Method and Description |
---|---|
Result |
accepts(Context context)
Returns true if the document referenced by this context is accepted by this selector
|
Result |
accepts(DocumentOperation op)
Returns true if the document referenced by this document operation is accepted by this selector
|
ResultList |
getMatchingResultList(Context context)
Returns the list of different variables resulting in a true state for this
expression.
|
ResultList |
getMatchingResultList(DocumentOperation op)
Returns the list of different variables resulting in a true state for this
expression.
|
OrderingSpecification |
getOrdering(int order)
Returns the ordering specification, if any, implied by this document
selection expression.
|
String |
toString()
Returns this selector as a Document Selection Language string.
|
void |
visit(Visitor visitor)
Visits the expression tree.
|
private ExpressionNode expression
public DocumentSelector(String selector) throws ParseException
selector
- The string to parse as a selector.ParseException
- Thrown if the string could not be parsed.public Result accepts(DocumentOperation op)
op
- A document operationRuntimeException
- if the evaluation enters an illegal statepublic Result accepts(Context context)
context
- The context to match in.RuntimeException
- if the evaluation enters an illegal statepublic ResultList getMatchingResultList(DocumentOperation op)
op
- The document to evaluate.RuntimeException
- if the evaluation enters an illegal statepublic ResultList getMatchingResultList(Context context)
context
- The context to match in.RuntimeException
- if the evaluation enters an illegal statepublic String toString()
public OrderingSpecification getOrdering(int order)
order
- The order of thepublic void visit(Visitor visitor)
visitor
- The visitor to use.Copyright © 2017. All rights reserved.