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

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

public abstract class FilterTerm
extends java.lang.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 OR
          Constant marking OR-terms.
 
Method Summary
 java.lang.Object accept(FilterEvaluationVisitor visitor, java.lang.Object context)
          Visitor dispatch callback used for evaluating filter criteria.
 FilterTerm add(FilterCriterion filter)
          Adds the given filter to the list of criteria.
 FilterAndTerm addAndTerm()
          Creates a new AND-term 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.
 java.util.List getParts()
          Gets the list of filter criteria this term contains.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, 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
Method Detail

getKind

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

Returns:
The kind, either AND or OR.

getParts

public java.util.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.

accept

public java.lang.Object accept(FilterEvaluationVisitor visitor,
                               java.lang.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.


Copyright © 2014 SunGard CSA LLC. All Rights Reserved.