org.eclipse.stardust.engine.api.query
Class FilterTerm

java.lang.Object
  extended by org.eclipse.stardust.engine.api.query.FilterTerm
All Implemented Interfaces:
Serializable, FilterCriterion
Direct Known Subclasses:
FilterAndTerm, FilterOrTerm

public abstract class FilterTerm
extends Object
implements FilterCriterion

Filter criterion providing filter criteria groups. Grouped can be built by either ANDing or ORing the contained criteria.

For convenience there exist subclasses FilterAndTerm and FilterOrTerm providing smoother handling.

Version:
$Revision$
Author:
rsauer
See Also:
Serialized Form

Nested Class Summary
static class FilterTerm.Kind
          Enumeration for filter term kind definition.
 
Field Summary
static FilterTerm.Kind AND
          Constant marking AND-terms.
static FilterTerm.Kind ANDNOT
          Constant marking AND NOT -terms.
static FilterTerm.Kind OR
          Constant marking OR-terms.
static FilterTerm.Kind ORNOT
          Constant marking OR NOT-terms.
 
Method Summary
 Object accept(FilterEvaluationVisitor visitor, Object context)
          Visitor dispatch callback used for evaluating filter criteria.
 FilterTerm add(FilterCriterion filter)
          Adds the given filter to the list of criteria.
 org.eclipse.stardust.engine.api.query.FilterAndNotTerm addAndNotTerm()
          Creates a new AND NOT-term and adds it to callee term.
 FilterAndTerm addAndTerm()
          Creates a new AND-term and adds it to callee term.
 org.eclipse.stardust.engine.api.query.FilterOrNotTerm addOrNotTerm()
          Creates a new OR NOT-term and adds and adds it to callee term.
 FilterOrTerm addOrTerm()
          Creates a new OR-term and adds and adds it to callee term.
 FilterTerm.Kind getKind()
          Gets the kind of this filter term.
 List getParts()
          Gets the list of filter criteria this term contains.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AND

public static final FilterTerm.Kind AND
Constant marking AND-terms.

See Also:
OR

OR

public static final FilterTerm.Kind OR
Constant marking OR-terms.

See Also:
AND

ORNOT

public static final FilterTerm.Kind ORNOT
Constant marking OR NOT-terms.

See Also:
AND

ANDNOT

public static final FilterTerm.Kind ANDNOT
Constant marking AND NOT -terms.

See Also:
AND
Method Detail

getKind

public FilterTerm.Kind getKind()
Gets the kind of this filter term.

Returns:
The kind, either AND or OR.

getParts

public List getParts()
Gets the list of filter criteria this term contains.

Returns:
The unmodifiable list of contained filter criteria.

add

public FilterTerm add(FilterCriterion filter)
               throws UnsupportedFilterException
Adds the given filter to the list of criteria.

Parameters:
filter - The filter criterion to add.
Returns:
The callee, thus allowing chained calls.
Throws:
UnsupportedFilterException - if the filter criterion to be added is not valid for thes query this filter term belongs to

addAndTerm

public FilterAndTerm addAndTerm()
Creates a new AND-term and adds it to callee term.

Returns:
The newly created AND-term, thus allowing chained calls.

addOrTerm

public FilterOrTerm addOrTerm()
Creates a new OR-term and adds and adds it to callee term.

Returns:
The newly created OR-term, thus allowing chained calls.

addAndNotTerm

public org.eclipse.stardust.engine.api.query.FilterAndNotTerm addAndNotTerm()
Creates a new AND NOT-term and adds it to callee term.

Returns:
The newly created AND NOT-term, thus allowing chained calls.

addOrNotTerm

public org.eclipse.stardust.engine.api.query.FilterOrNotTerm addOrNotTerm()
Creates a new OR NOT-term and adds and adds it to callee term.

Returns:
The newly created OR NOT-term, thus allowing chained calls.

accept

public Object accept(FilterEvaluationVisitor visitor,
                     Object context)
Description copied from interface: FilterCriterion
Visitor dispatch callback used for evaluating filter criteria. Usually implemented as return visitor.visit(this, context), thus calling the appropriately overloaded visitation method.

Specified by:
accept in interface FilterCriterion
Parameters:
visitor - The visitor performing the evaluation.
context - Information used by the visitor during the visitation process.
Returns:
Visitor specific result of the visitation.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2017 Eclipse Stardust. All Rights Reserved.