Package org.geotools.filter
Class ExpressionSAXParser
Object
ExpressionSAXParser
- Author:
- Rob Hranac, TOPP
, Chris Holmes, TOPP
-
Constructor Summary
ConstructorsConstructorDescriptionExpressionSAXParser
(SimpleFeatureType schema) Constructor with a schema to read the attribute againset.ExpressionSAXParser
(SimpleFeatureType schema, FilterFactory factory) Constructor injectionExpressionSAXParser
(FilterFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionprotected static short
convertType
(String expType) Converts the string representation of the expression to the DefaultExpression short type.create()
Creates and returns the expression.void
Called when the filter handler has reached the end of an expressionvoid
Gets geometry.stolen from the DOM parser -- for a list of attributes, find the "name" ie. forreturn "geomLength" NOTE: if someone uses or <Function ogc:name="geomLength"> this will work, if they use a different prefix, it will not. boolean
isReady()
Checks to see if this expression is ready to be returned.void
Handles incoming characters.void
setFilterFactory
(FilterFactory factory) Setter injectionvoid
start
(String declaredType, Attributes atts) Initializes the factory to create a new expression.
-
Constructor Details
-
ExpressionSAXParser
public ExpressionSAXParser() -
ExpressionSAXParser
-
ExpressionSAXParser
Constructor with a schema to read the attribute againset.- Parameters:
schema
- The schema for attributes (null is fine, as the code for this is not in place.
-
ExpressionSAXParser
Constructor injection
-
-
Method Details
-
setFilterFactory
Setter injection -
start
Initializes the factory to create a new expression. Called when the filter handler reaches a new expression.- Parameters:
declaredType
- The string representation of the expression type.- Throws:
IllegalFilterException
- If there are problems creating expressions.
-
end
Called when the filter handler has reached the end of an expression- Parameters:
message
- the expression to end.- Throws:
IllegalFilterException
- If there are problems creating exceptions.
-
isReady
public boolean isReady()Checks to see if this expression is ready to be returned.- Returns:
- true if the expression is ready to be returned, false otherwise.
-
message
Handles incoming characters.- Parameters:
message
- the incoming chars from the SAX handler.- Throws:
IllegalFilterException
- If there are problems with filter constrcution.- TODO:
- TODO: this function is a mess, but it's mostly due to filters being loosely coupled with schemas, so we have to make a lot of guesses., TODO: Revisit stripping leading characters. Needed now to get things working, and may be the best choice in the end, but it should be thought through more.
-
geometry
Gets geometry.- Parameters:
geometry
- The geometry from the filter.- Throws:
IllegalFilterException
- If there are problems creating expression.
-
create
Creates and returns the expression.- Returns:
- The expression currently held by this parser.
- TODO:
- REVISIT: shouldn't this check the readyFlag?
-
convertType
Converts the string representation of the expression to the DefaultExpression short type.- Parameters:
expType
- Type of filter for check.- Returns:
- the short representation of the expression.
-
getFunctionName
stolen from the DOM parser -- for a list of attributes, find the "name" ie. forreturn "geomLength" NOTE: if someone uses or <Function ogc:name="geomLength"> this will work, if they use a different prefix, it will not.
-