org.geotools.filter
Class SQLEncoderOracle

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

public class SQLEncoderOracle
extends SQLEncoder

Encodes Geometry filters into valid oracle SDO statements.

At this stage it only supports the GEOMETRY_BBOX types.

Encoded filters get written to the protected Writer called out

Version:
$Id: SQLEncoderOracle.java 18021 2006-02-14 20:36:18Z jdeolive $
Author:
$Author: seangeo $

Field Summary
 
Fields inherited from class org.geotools.filter.SQLEncoder
mapper, out
 
Constructor Summary
SQLEncoderOracle(int defaultSRID)
           
SQLEncoderOracle(java.util.Map srids)
          Creates a new SQLEncoderOracle with a specified SRID.
SQLEncoderOracle(java.lang.String fidColumn, int defaultSRID)
           
SQLEncoderOracle(java.lang.String fidColumn, java.util.Map srids)
          Creates a new SQLEncoderOracle with a specified SRID.
 
Method Summary
protected  FilterCapabilities createFilterCapabilities()
          Sets the capabilities of this filter.
static java.lang.String toSDOGeom(com.vividsolutions.jts.geom.Geometry geometry, int srid)
          Converts JTS Geometry to a String version of a SDO Geometry.
 void visit(AttributeExpression ae)
          Writes the SQL for the attribute Expression.
 void visit(FidFilter filter)
          DOCUMENT ME!
 void visit(GeometryFilter geomFilter)
          Handles Geometry Filter encoding.
 void visit(LikeFilter filter)
          Writes the SQL for the Like Filter.
 void visit(LiteralExpression literal)
          Converts a literal expression into a valid SDO object.
 
Methods inherited from class org.geotools.filter.SQLEncoder
encode, encode, escapeName, getCapabilities, getColnameEscape, setColnameEscape, setFIDMapper, setSqlNameEscape, visit, visit, visit, visit, visit, visit, visit, visit, visitLiteralGeometry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLEncoderOracle

public SQLEncoderOracle(java.lang.String fidColumn,
                        int defaultSRID)

SQLEncoderOracle

public SQLEncoderOracle(int defaultSRID)

SQLEncoderOracle

public SQLEncoderOracle(java.lang.String fidColumn,
                        java.util.Map srids)
Creates a new SQLEncoderOracle with a specified SRID.

Parameters:
srids - DOCUMENT ME!

SQLEncoderOracle

public SQLEncoderOracle(java.util.Map srids)
Creates a new SQLEncoderOracle with a specified SRID.

Parameters:
srids - The Spatial Reference ID to use when generating SDO SQL statements.
Method Detail

createFilterCapabilities

protected FilterCapabilities createFilterCapabilities()
Sets the capabilities of this filter.

Overrides:
createFilterCapabilities in class SQLEncoder
Returns:
FilterCapabilities for this Filter

toSDOGeom

public static java.lang.String toSDOGeom(com.vividsolutions.jts.geom.Geometry geometry,
                                         int srid)
Converts JTS Geometry to a String version of a SDO Geometry. This should move to a utility class, as we now have more than one class using this (which is why it changed to public static). TODO: Multi Geometries

Parameters:
geometry - The JTS Geometry to convert.
srid - DOCUMENT ME!
Returns:
A String representation of the SDO Geometry.

visit

public void visit(GeometryFilter geomFilter)
Handles Geometry Filter encoding. Currently only supports the encoding of GEOMETRY_BBOX filters. If a GEOMETRY_BBOX filter is encounter it will be converted into an SDO_RELATE() function. If another filter is found, nothing will happen.

Specified by:
visit in interface FilterVisitor
Overrides:
visit in class SQLEncoder
Parameters:
geomFilter - The geometry filter to encode.
See Also:
FilterVisitor.visit(org.geotools.filter.GeometryFilter)

visit

public void visit(LikeFilter filter)
Writes the SQL for the Like Filter. Assumes the current java implemented wildcards for the Like Filter: . for multi and .? for single. And replaces them with the SQL % and _, respectively. Currently does nothing, and should not be called, not included in the capabilities.

Specified by:
visit in interface FilterVisitor
Overrides:
visit in class SQLEncoder
Parameters:
filter - the Like Filter to be visited.
Task:
TODO: LikeFilter doesn't work right...revisit this when it does. Need to think through the escape char, so it works right when Java uses one, and escapes correctly with an '_'.

visit

public void visit(LiteralExpression literal)
Converts a literal expression into a valid SDO object. Only handles Literal Geometries, all other literals are passed up to the parent.

Specified by:
visit in interface FilterVisitor
Overrides:
visit in class SQLEncoder
Parameters:
literal - The Literal expression to encode.
See Also:
FilterVisitor.visit(org.geotools.filter.expression.LiteralExpression)

visit

public void visit(FidFilter filter)
DOCUMENT ME!

Specified by:
visit in interface FilterVisitor
Overrides:
visit in class SQLEncoder
Parameters:
filter -
See Also:
SQLEncoder.visit(org.geotools.filter.FidFilter)

visit

public void visit(AttributeExpression ae)
           throws java.lang.RuntimeException
Description copied from class: SQLEncoder
Writes the SQL for the attribute Expression.

Specified by:
visit in interface FilterVisitor
Overrides:
visit in class SQLEncoder
Parameters:
ae - the attribute to turn to SQL.
Throws:
java.lang.RuntimeException - for io exception with writer


Copyright © GeoTools. All Rights Reserved.