org.geotools.filter
Class XMLEncoder

java.lang.Object
  extended byorg.geotools.filter.XMLEncoder
All Implemented Interfaces:
FilterVisitor

Deprecated. Use org.geotools.filter.FilterTransformer

public class XMLEncoder
extends java.lang.Object
implements FilterVisitor

Exports a filter as a OGC XML Filter document. This class is does not generate namespace compliant xml, even though it does print gml prefixes. It was also written before the 1.0 filter spec, so some of it may be not up to date.

Author:
James Macgill, PSU
Task:
HACK: Logging errors, very bad! We need a filter visitor exception, or have visit methods throw illegal filter exceptions, or io exceptions., TODO: Support full header information for new XML file, REVISIT: make filter utils class so that other encoders (like sql). It could also be nice to refactor common code from gml producer, as there is basically a GeometryProducer there., REVISIT: make namespace aware.

Constructor Summary
XMLEncoder(java.io.Writer out)
          Deprecated. Constructor with writer to write filters to.
XMLEncoder(java.io.Writer out, Filter filter)
          Deprecated. Creates a new instance of XMLEncoder
 
Method Summary
 void encode(Expression expression)
          Deprecated. Encodes the expression to the current writer.
 void encode(Filter filter)
          Deprecated. Encodes the filter to the current writer.
 void visit(AttributeExpression expression)
          Deprecated. Writes the xml representation of an Attribute expression.
 void visit(BetweenFilter filter)
          Deprecated. Writes the xml representation of a Between filter.
 void visit(CompareFilter filter)
          Deprecated. Writes the xml representation of a compare filter.
 void visit(Expression expression)
          Deprecated. This should never be called.
 void visit(FidFilter filter)
          Deprecated. Writes the xml representation of a fid filter.
 void visit(Filter filter)
          Deprecated. This should never be called.
 void visit(FunctionExpression expression)
          Deprecated. Writes the xml representation of a expression.
 void visit(GeometryFilter filter)
          Deprecated. Writes the xml representation of a geometry filter.
 void visit(LikeFilter filter)
          Deprecated. Writes the xml representation of a like filter.
 void visit(LiteralExpression expression)
          Deprecated. Export the contents of a Literal Expresion
 void visit(LogicFilter filter)
          Deprecated. Writes the xml representation of a logic filter.
 void visit(MathExpression expression)
          Deprecated. Writes the xml representation of a expression.
 void visit(NullFilter filter)
          Deprecated. Writes the xml representation of a null filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLEncoder

public XMLEncoder(java.io.Writer out)
Deprecated. 
Constructor with writer to write filters to.

Parameters:
out - where to write the xml representation of filters.

XMLEncoder

public XMLEncoder(java.io.Writer out,
                  Filter filter)
Deprecated. 
Creates a new instance of XMLEncoder

Parameters:
out - The writer to write to.
filter - the filter to encode.
Method Detail

encode

public void encode(Filter filter)
            throws java.io.IOException
Deprecated. 
Encodes the filter to the current writer.

Parameters:
filter - the filter to encode.
Throws:
java.io.IOException - if there are problems writing to out.

encode

public void encode(Expression expression)
Deprecated. 
Encodes the expression to the current writer.

Parameters:
expression - the expression to encode.

visit

public void visit(Filter filter)
Deprecated. 
This should never be called. This can only happen if a subclass of AbstractFilter failes to implement its own version of accept(FilterVisitor);

Specified by:
visit in interface FilterVisitor
Parameters:
filter - The filter to visit

visit

public void visit(BetweenFilter filter)
Deprecated. 
Writes the xml representation of a Between filter.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - the between filter to encode.

visit

public void visit(LikeFilter filter)
Deprecated. 
Writes the xml representation of a like filter.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - the like filter to encode.

visit

public void visit(LogicFilter filter)
Deprecated. 
Writes the xml representation of a logic filter.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - the logic filter to encode.

visit

public void visit(CompareFilter filter)
Deprecated. 
Writes the xml representation of a compare filter.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - the compare filter to encode.

visit

public void visit(GeometryFilter filter)
Deprecated. 
Writes the xml representation of a geometry filter.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - the geometry filter to encode.

visit

public void visit(NullFilter filter)
Deprecated. 
Writes the xml representation of a null filter.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - the null filter to encode.

visit

public void visit(FidFilter filter)
Deprecated. 
Writes the xml representation of a fid filter.

Specified by:
visit in interface FilterVisitor
Parameters:
filter - the fid filter to encode.

visit

public void visit(AttributeExpression expression)
Deprecated. 
Writes the xml representation of an Attribute expression.

Specified by:
visit in interface FilterVisitor
Parameters:
expression - the attribute expression to encode.

visit

public void visit(Expression expression)
Deprecated. 
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 encode.

visit

public void visit(LiteralExpression expression)
Deprecated. 
Export the contents of a Literal Expresion

Specified by:
visit in interface FilterVisitor
Parameters:
expression - the Literal to export
Task:
TODO: Fully support GeometryExpressions so that they are writen as GML.

visit

public void visit(MathExpression expression)
Deprecated. 
Writes the xml representation of a expression.

Specified by:
visit in interface FilterVisitor
Parameters:
expression - the expression to encode.

visit

public void visit(FunctionExpression expression)
Deprecated. 
Writes the xml representation of a expression.

Specified by:
visit in interface FilterVisitor
Parameters:
expression - the expression to encode.


Copyright © GeoTools. All Rights Reserved.