org.geotools.filter.visitor
Class AbstractFilterVisitor

java.lang.Object
  extended byorg.geotools.filter.visitor.AbstractFilterVisitor
All Implemented Interfaces:
FilterVisitor
Direct Known Subclasses:
DuplicatorFilterVisitor

public class AbstractFilterVisitor
extends java.lang.Object
implements FilterVisitor

A basic implementation of the FilterVisitor interface.

This class implements the full FilterVisitor interface and will visit every 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 expression types you are interested in. Remember to call the super method if you want to ensure that the entier filter tree is still visited.

You may still need to implement FilterVisitor directly if the visit order set out in this class does not meet your needs. This class visits in sequence i.e. Left - Middle - Right for all expressions which have sub-expressions.

Author:
James Macgill, Penn State

Constructor Summary
AbstractFilterVisitor()
          Empty constructor
 
Method Summary
 void visit(AttributeExpression expression)
          Called when accept is called on an attribute expression.
 void visit(BetweenFilter filter)
          Called when accept is called on a BetweenFilter.
 void visit(CompareFilter filter)
          Called when accept is called on a Compare Filter.
 void visit(Expression expression)
          This should never be called.
 void visit(FidFilter filter)
          Called when accept is called on a Fid Filter.
 void visit(Filter filter)
          Called when accept is called on an AbstractFilter.
 void visit(FunctionExpression expression)
          Called when accept is called on an function expression.
 void visit(GeometryFilter filter)
          Called when accept is called on a Geometry Filter.
 void visit(LikeFilter filter)
          Called when accept is called on a Like Filter.
 void visit(LiteralExpression expression)
          Called when accept is called on a literal expression.
 void visit(LogicFilter filter)
          Called when accept is called on a Logic Filter.
 void visit(MathExpression expression)
          Called when accept is called on an math expression.
 void visit(NullFilter filter)
          Called when accept is called on a Null Filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFilterVisitor

public AbstractFilterVisitor()
Empty constructor

Method Detail

visit

public void visit(Filter filter)
Description copied from interface: FilterVisitor
Called when accept is called on an AbstractFilter. As it is imposible to create an instance of AbstractFilter this should never happen. If it does it means that a subclass of AbstractFilter has failed to implement accept(FilterVisitor) correctly. Implementers of this method should probaly log a warning.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - The filter to visit
See Also:
FilterVisitor.visit(org.geotools.filter.Filter)

visit

public void visit(BetweenFilter filter)
Description copied from interface: FilterVisitor
Called when accept is called on a BetweenFilter. Implementers will want to access the left, middle and right expresions.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - The filter to visit
See Also:
FilterVisitor.visit(org.geotools.filter.BetweenFilter)

visit

public void visit(CompareFilter filter)
Description copied from interface: FilterVisitor
Called when accept is called on a Compare Filter. Implementers will want to access the left and right expresions.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - The filter to visit
See Also:
FilterVisitor.visit(org.geotools.filter.CompareFilter)

visit

public void visit(GeometryFilter filter)
Description copied from interface: FilterVisitor
Called when accept is called on a Geometry Filter. Implementers will want to access the left and right geometries.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - The filter to visit
See Also:
FilterVisitor.visit(org.geotools.filter.GeometryFilter)

visit

public void visit(LikeFilter filter)
Description copied from interface: FilterVisitor
Called when accept is called on a Like Filter. Implementers will want to access the pattern and value.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - The filter to visit.
See Also:
FilterVisitor.visit(org.geotools.filter.LikeFilter)

visit

public void visit(LogicFilter filter)
Description copied from interface: FilterVisitor
Called when accept is called on a Logic Filter. Implementers will want to access the sub filters.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - The filter to visit.
See Also:
FilterVisitor.visit(org.geotools.filter.LogicFilter)

visit

public void visit(NullFilter filter)
Description copied from interface: FilterVisitor
Called when accept is called on a Null Filter. Implementers will want to access the null check.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - The filter to visit.
See Also:
FilterVisitor.visit(org.geotools.filter.NullFilter)

visit

public void visit(FidFilter filter)
Description copied from interface: FilterVisitor
Called when accept is called on a Fid Filter. Implementers will want to access the fids.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - The filter to visit.
See Also:
FilterVisitor.visit(org.geotools.filter.FidFilter)

visit

public void visit(AttributeExpression expression)
Description copied from interface: FilterVisitor
Called when accept is called on an attribute expression. Implementors will want to access the attribute.

Specified by:
visit in interface FilterVisitor
Parameters:
expression - The expression to visit.
See Also:
FilterVisitor.visit(org.geotools.filter.expression.AttributeExpression)

visit

public void visit(Expression expression)
Description copied from interface: FilterVisitor
This should never be called. This can only happen if a subclass of DefaultExpression fails to implement its own version of accept(FilterVisitor);

Specified by:
visit in interface FilterVisitor
Parameters:
expression - the expression to visit.
See Also:
FilterVisitor.visit(org.geotools.filter.expression.Expression)

visit

public void visit(LiteralExpression expression)
Description copied from interface: FilterVisitor
Called when accept is called on a literal expression. Implementors will want to access the literal.

Specified by:
visit in interface FilterVisitor
Parameters:
expression - The expression to visit.
See Also:
FilterVisitor.visit(org.geotools.filter.expression.LiteralExpression)

visit

public void visit(MathExpression expression)
Description copied from interface: FilterVisitor
Called when accept is called on an math expression.

Specified by:
visit in interface FilterVisitor
Parameters:
expression - The expression to visit.
See Also:
FilterVisitor.visit(org.geotools.filter.expression.MathExpression)

visit

public void visit(FunctionExpression expression)
Description copied from interface: FilterVisitor
Called when accept is called on an function expression.

Specified by:
visit in interface FilterVisitor
Parameters:
expression - The expression to visit.
See Also:
FilterVisitor.visit(org.geotools.filter.expression.FunctionExpression)


Copyright © GeoTools. All Rights Reserved.