org.geotools.filter.visitor
Class DefaultFilterVisitor

Object
  extended by DefaultFilterVisitor
All Implemented Interfaces:
ExpressionVisitor, FilterVisitor
Direct Known Subclasses:
FilterAttributeExtractor, GeometryEncoderSDE, GeometryTransformationVisitor, IdCollectorFilterVisitor, SpatialFilterVisitor, Utils.BBOXFilterExtractor

public abstract class DefaultFilterVisitor
extends Object
implements FilterVisitor, ExpressionVisitor

Abstract implementation of FilterVisitor that simply walks the data structure.

This class implements the full FilterVisitor interface and will visit every Filter member of a Filter object. This class performs no actions and is not intended to be used directly, instead extend it and overide the methods for the Filter type you are interested in. Remember to call the super method if you want to ensure that the entire filter tree is still visited.


 FilterVisitor allFids = new DefaultFilterVisitor(){
     public Object visit( Id filter, Object data ) {
         Set set = (Set) data;
         set.addAll(filter.getIDs());
         return set;
     }
 };
 Set set = (Set) myFilter.accept(allFids, new HashSet());
 

Author:
Jody

Constructor Summary
DefaultFilterVisitor()
           
 
Method Summary
 Object visit(Add expression, Object data)
           
 Object visit(After after, Object data)
           
 Object visit(And filter, Object data)
           
 Object visit(AnyInteracts anyInteracts, Object data)
           
 Object visit(BBOX filter, Object data)
           
 Object visit(Before before, Object data)
           
 Object visit(Begins begins, Object data)
           
 Object visit(BegunBy begunBy, Object data)
           
 Object visit(Beyond filter, Object data)
           
 Object visit(Contains filter, Object data)
           
 Object visit(Crosses filter, Object data)
           
 Object visit(Disjoint filter, Object data)
           
 Object visit(Divide expression, Object data)
           
 Object visit(During during, Object data)
           
 Object visit(DWithin filter, Object data)
           
 Object visit(EndedBy endedBy, Object data)
           
 Object visit(Ends ends, Object data)
           
 Object visit(Equals filter, Object data)
           
 Object visit(ExcludeFilter filter, Object data)
          Visit Filter.EXCLUDE (often used during data structure transformations).
 Object visit(Function expression, Object data)
           
 Object visit(Id filter, Object data)
           
 Object visit(IncludeFilter filter, Object data)
          Visit Filter.INCLUDE (often used during data structure transformations).
 Object visit(Intersects filter, Object data)
           
 Object visit(Literal expression, Object data)
           
 Object visit(Meets meets, Object data)
           
 Object visit(MetBy metBy, Object data)
           
 Object visit(Multiply expression, Object data)
           
 Object visit(NilExpression expression, Object data)
          Used to visit a Expression.NIL, also called for null where an expression is expected.
 Object visit(Not filter, Object data)
           
 Object visit(Or filter, Object data)
           
 Object visit(OverlappedBy overlappedBy, Object data)
           
 Object visit(Overlaps filter, Object data)
           
 Object visit(PropertyIsBetween filter, Object data)
           
 Object visit(PropertyIsEqualTo filter, Object data)
           
 Object visit(PropertyIsGreaterThan filter, Object data)
           
 Object visit(PropertyIsGreaterThanOrEqualTo filter, Object data)
           
 Object visit(PropertyIsLessThan filter, Object data)
           
 Object visit(PropertyIsLessThanOrEqualTo filter, Object data)
           
 Object visit(PropertyIsLike filter, Object data)
           
 Object visit(PropertyIsNil filter, Object data)
           
 Object visit(PropertyIsNotEqualTo filter, Object data)
           
 Object visit(PropertyIsNull filter, Object data)
           
 Object visit(PropertyName expression, Object data)
           
 Object visit(Subtract expression, Object data)
           
 Object visit(TContains contains, Object data)
           
 Object visit(TEquals equals, Object data)
           
 Object visit(Touches filter, Object data)
           
 Object visit(TOverlaps contains, Object data)
           
 Object visit(Within filter, Object data)
           
 Object visitNullFilter(Object data)
          Used to account for a null filter value.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFilterVisitor

public DefaultFilterVisitor()
Method Detail

visit

public Object visit(ExcludeFilter filter,
                    Object data)
Description copied from interface: FilterVisitor
Visit Filter.EXCLUDE (often used during data structure transformations).

Specified by:
visit in interface FilterVisitor
Parameters:
filter - Filter.EXCLUDE.
data - Value object provided to visitor
Returns:
subclass supplied

visit

public Object visit(IncludeFilter filter,
                    Object data)
Description copied from interface: FilterVisitor
Visit Filter.INCLUDE (often used during data structure transformations).

Specified by:
visit in interface FilterVisitor
Parameters:
filter - Filter.INCLUDE.
data - Value object provided to visitor
Returns:
subclass supplied

visit

public Object visit(And filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Id filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Not filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Or filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsBetween filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsEqualTo filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsNotEqualTo filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsGreaterThan filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsGreaterThanOrEqualTo filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsLessThan filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsLessThanOrEqualTo filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsLike filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsNull filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(PropertyIsNil filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(BBOX filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Beyond filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Contains filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Crosses filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Disjoint filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(DWithin filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Equals filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Intersects filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Overlaps filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Touches filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Within filter,
                    Object data)
Specified by:
visit in interface FilterVisitor

visitNullFilter

public Object visitNullFilter(Object data)
Description copied from interface: FilterVisitor
Used to account for a null filter value.

This is particularly used during data structure transofrmations, however the use of null is not recommended. Please make use of Filter.NONE and Filter.ALL as placeholder objects that communicate intent.

Specified by:
visitNullFilter in interface FilterVisitor
Parameters:
data - Value object provided to visitor
Returns:
subclass defined

visit

public Object visit(NilExpression expression,
                    Object data)
Description copied from interface: ExpressionVisitor
Used to visit a Expression.NIL, also called for null where an expression is expected.

This is particularly useful when doing data transformations, as an example when using a StyleSymbolizer Expression.NIL can be used to represent the default stroke color.

Specified by:
visit in interface ExpressionVisitor
Returns:
implementation specific

visit

public Object visit(Add expression,
                    Object data)
Specified by:
visit in interface ExpressionVisitor

visit

public Object visit(Divide expression,
                    Object data)
Specified by:
visit in interface ExpressionVisitor

visit

public Object visit(Function expression,
                    Object data)
Specified by:
visit in interface ExpressionVisitor

visit

public Object visit(Literal expression,
                    Object data)
Specified by:
visit in interface ExpressionVisitor

visit

public Object visit(Multiply expression,
                    Object data)
Specified by:
visit in interface ExpressionVisitor

visit

public Object visit(PropertyName expression,
                    Object data)
Specified by:
visit in interface ExpressionVisitor

visit

public Object visit(Subtract expression,
                    Object data)
Specified by:
visit in interface ExpressionVisitor

visit

public Object visit(After after,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(AnyInteracts anyInteracts,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Before before,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Begins begins,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(BegunBy begunBy,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(During during,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(EndedBy endedBy,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Ends ends,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(Meets meets,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(MetBy metBy,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(OverlappedBy overlappedBy,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(TContains contains,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(TEquals equals,
                    Object data)
Specified by:
visit in interface FilterVisitor

visit

public Object visit(TOverlaps contains,
                    Object data)
Specified by:
visit in interface FilterVisitor


Copyright © 1996-2014 Geotools. All Rights Reserved.