Package org.geotools.filter
Class FilterSAXParser
- Object
- 
- FilterSAXParser
 
- 
 public class FilterSAXParser extends Object 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 SummaryConstructors Constructor Description FilterSAXParser()Constructor which flags the operator as between.FilterSAXParser(FilterFactory factory)Constructor injdection
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Filtercreate()Creates the filter held in the parser.voidexpression(Expression expression)Adds the passed in expression to the current filter.voidsetAttributes(Attributes atts)Sets the filter attributes.voidsetDistance(String distance, String units)This sets the distance for a GeometryDistanceFilter.voidsetFilterFactory(FilterFactory factory)Setter injectionvoidstart(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.voidvalue(String message)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 Detail- 
FilterSAXParserpublic FilterSAXParser() Constructor which flags the operator as between.
 - 
FilterSAXParserpublic FilterSAXParser(FilterFactory factory) Constructor injdection
 
- 
 - 
Method Detail- 
setFilterFactorypublic void setFilterFactory(FilterFactory factory) Setter injection
 - 
startpublic void start(short filterType) throws IllegalFilterExceptionHandles 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.
 
 - 
valuepublic void value(String message) throws IllegalFilterException 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.
 
 - 
expressionpublic void expression(Expression expression) throws IllegalFilterException 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.
 
 - 
createpublic Filter create() throws IllegalFilterException 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.
 
 - 
setDistancepublic void setDistance(String distance, String units) throws IllegalFilterException 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.
 
 - 
setAttributespublic void setAttributes(Attributes atts) 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.
 
 
- 
 
-