Package com.yahoo.document.select
Class DocumentSelector
- java.lang.Object
-
- com.yahoo.document.select.DocumentSelector
-
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.
- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description DocumentSelector(String selector)
Creates a document selector from a Document Selection Language string
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Result
accepts(DocumentOperation op)
Returns true if the document referenced by this document operation is accepted by this selectorResult
accepts(Context context)
Returns true if the document referenced by this context is accepted by this selectorResultList
getMatchingResultList(DocumentOperation op)
Returns the list of different variables resulting in a true state for this expressionString
toString()
Returns this selector as a Document Selection Language stringvoid
visit(Visitor visitor)
Visits the expression tree
-
-
-
Constructor Detail
-
DocumentSelector
public DocumentSelector(String selector) throws ParseException
Creates a document selector from a Document Selection Language string- Parameters:
selector
- the string to parse as a selector- Throws:
ParseException
- Thrown if the string could not be parsed
-
-
Method Detail
-
accepts
public Result accepts(DocumentOperation op)
Returns true if the document referenced by this document operation is accepted by this selector- Parameters:
op
- a document operation- Returns:
- true if the document is accepted
- Throws:
RuntimeException
- if the evaluation enters an illegal state
-
accepts
public Result accepts(Context context)
Returns true if the document referenced by this context is accepted by this selector- Parameters:
context
- the context to match in- Returns:
- true if the document is accepted
- Throws:
RuntimeException
- if the evaluation enters an illegal state
-
getMatchingResultList
public ResultList getMatchingResultList(DocumentOperation op)
Returns the list of different variables resulting in a true state for this expression- Parameters:
op
- the document to evaluate- Returns:
- true if the document is accepted
- Throws:
RuntimeException
- if the evaluation enters an illegal state
-
toString
public String toString()
Returns this selector as a Document Selection Language string
-
visit
public void visit(Visitor visitor)
Visits the expression tree
-
-