org.geotools.filter
Interface FilterVisitor

All Known Implementing Classes:
AbstractFilterVisitor, BoundsExtractor, DataUtilities.AbstractFilterVisitor, FilterAttributeExtractor, FilterConsumer, FilterTransformer.FilterTranslator, GeometryEncoderSDE, ReplaceGeometryFilter, SQLEncoder, SQLEncoderBBOX, SQLEncoderDB2, SQLEncoderHsql, SQLEncoderLocationsXY, SQLEncoderMySQL, SQLEncoderPostgis, SQLEncoderPostgisGeos, SQLEncoderSDE, WFSFilterVisitor, WFSFilterVisitor.WFSBBoxFilterVisitor, XMLEncoder

public interface FilterVisitor

An interface for classes that want to perform operations on a Filter hiarachy. It forms part of a GoF Visitor Patern implementation. A call to filter.accept(FilterVisitor) will result in a call to one of the methods in this interface. The responsibility for traversing sub filters is intended to lie with the visitor (this is unusual, but permited under the Visitor pattern). A typical use would be to transcribe a filter into a specific format, e.g. XML or SQL. Alternativly it may be to extract specific infomration from the Filter strucure, for example a list of all bboxes.

Version:
$Id: FilterVisitor.java 18021 2006-02-14 20:36:18Z jdeolive $
Author:
James Macgill
Task:
REVISIT: These need to throw some sort of checked exception as the implementing classes are swallowing exceptions or throwing runtime ones.

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.
 

Method Detail

visit

public void visit(Filter filter)
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.

Parameters:
filter - The filter to visit

visit

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

Parameters:
filter - The filter to visit

visit

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

Parameters:
filter - The filter to visit

visit

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

Parameters:
filter - The filter to visit

visit

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

Parameters:
filter - The filter to visit.

visit

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

Parameters:
filter - The filter to visit.

visit

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

Parameters:
filter - The filter to visit.

visit

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

Parameters:
filter - The filter to visit.

visit

public void visit(AttributeExpression expression)
Called when accept is called on an attribute expression. Implementors will want to access the attribute.

Parameters:
expression - The expression to visit.

visit

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

Parameters:
expression - the expression to visit.

visit

public void visit(LiteralExpression expression)
Called when accept is called on a literal expression. Implementors will want to access the literal.

Parameters:
expression - The expression to visit.

visit

public void visit(MathExpression expression)
Called when accept is called on an math expression.

Parameters:
expression - The expression to visit.

visit

public void visit(FunctionExpression expression)
Called when accept is called on an function expression.

Parameters:
expression - The expression to visit.


Copyright © GeoTools. All Rights Reserved.