Package org.geotools.filter
Class FilterSAXParser
Object
FilterSAXParser
Creates filters from FilterFilter, which reads in a SAX stream and passes the appropriate messages here.
- Author:
- Rob Hranac, Vision for New York
, Chris Holmes, TOPP
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor which flags the operator as between.FilterSAXParser
(FilterFactory factory) Constructor injdection -
Method Summary
Modifier and TypeMethodDescriptioncreate()
Creates the filter held in the parser.void
expression
(Expression expression) Adds the passed in expression to the current filter.void
setAttributes
(Attributes atts) Sets the filter attributes.void
setDistance
(String distance, String units) This sets the distance for a GeometryDistanceFilter.void
setFilterFactory
(FilterFactory factory) Setter injectionvoid
start
(short filterType) Handles all incoming generic string 'messages,' including a message to create the filter, based on the XML tag that represents the start of the filter.void
Handles all incoming generic string 'messages,' including a message to create the filter, based on the XML tag that represents the start of the filter.
-
Constructor Details
-
FilterSAXParser
public FilterSAXParser()Constructor which flags the operator as between. -
FilterSAXParser
Constructor injdection
-
-
Method Details
-
setFilterFactory
Setter injection -
start
Handles all incoming generic string 'messages,' including a message to create the filter, based on the XML tag that represents the start of the filter.- Parameters:
filterType
- The string from the SAX filter.- Throws:
IllegalFilterException
- Filter is illegal.
-
value
Handles all incoming generic string 'messages,' including a message to create the filter, based on the XML tag that represents the start of the filter.- Parameters:
message
- The string from the SAX filter.- Throws:
IllegalFilterException
- Filter is illegal.
-
expression
Adds the passed in expression to the current filter. Generally created by the ExpressionSAXParser.- Parameters:
expression
- The value of the attribute for comparison.- Throws:
IllegalFilterException
- if the expression does not match what the current filter is expecting.- TODO:
- REVISIT: split this method up.
-
create
Creates the filter held in the parser.- Returns:
- The current filter to be created by this parser.
- Throws:
IllegalFilterException
- If called before the filter is in a complete state.
-
setDistance
This sets the distance for a GeometryDistanceFilter. It currently ignores the units, and attempts to convert the distance to a double.- Parameters:
distance
- the distance - should be a string of a double.units
- a reference to a units dictionary.- Throws:
IllegalFilterException
- if the distance string can not be converted to a double.- TODO:
- TODO: Implement units, probably with org.geotools.units package and a special distance class in the filter package. It would be nice if the distance class could get any type of units, like it would handle the conversion.
-
setAttributes
Sets the filter attributes. Called when attributes are encountered by the filter filter. Puts them in a hash map by thier name and value.- Parameters:
atts
- the attributes to set.
-