org.vfny.geoserver.requests.wfs
Class FeatureHandler

java.lang.Object
  extended byorg.xml.sax.helpers.XMLFilterImpl
      extended byorg.vfny.geoserver.requests.wfs.FeatureHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.geotools.filter.FilterHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader

public class FeatureHandler
extends org.xml.sax.helpers.XMLFilterImpl
implements org.xml.sax.ContentHandler, org.geotools.filter.FilterHandler

Uses SAX to extact a GetFeature query from and incoming GetFeature request XML stream.

Note that this Handler extension ignores Filters completely and must be chained as a parent to the PredicateFilter method in order to recognize them. If it is not chained, it will still generate valid queries, but with no filtering whatsoever.


Constructor Summary
FeatureHandler()
          Empty constructor.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Checks if inside parsed element and adds its contents to the appropriate variable.
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String rawName)
          Notes the end of the element exists query or bounding box.
 void filter(org.geotools.filter.Filter filter)
          Gets a filter and adds it to the appropriate query (or queries).
 FeatureRequest getRequest()
          Returns the GetFeature request.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes atts)
          Notes the start of the element and sets type names and query attributes.
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 

Constructor Detail

FeatureHandler

public FeatureHandler()
Empty constructor.

Method Detail

getRequest

public FeatureRequest getRequest()
Returns the GetFeature request.

Returns:
The request read by this handler.

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String rawName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Notes the start of the element and sets type names and query attributes.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Parameters:
namespaceURI - URI for namespace appended to element.
localName - Local name of element.
rawName - Raw name of element.
atts - Element attributes.
Throws:
org.xml.sax.SAXException - When the XML is not well formed.

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String rawName)
                throws org.xml.sax.SAXException
Notes the end of the element exists query or bounding box.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Parameters:
namespaceURI - URI for namespace appended to element.
localName - Local name of element.
rawName - Raw name of element.
Throws:
org.xml.sax.SAXException - When the XML is not well formed.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Checks if inside parsed element and adds its contents to the appropriate variable.

Specified by:
characters in interface org.xml.sax.ContentHandler
Parameters:
ch - URI for namespace appended to element.
start - Local name of element.
length - Raw name of element.
Throws:
org.xml.sax.SAXException - When the XML is not well formed.

filter

public void filter(org.geotools.filter.Filter filter)
Gets a filter and adds it to the appropriate query (or queries).

Specified by:
filter in interface org.geotools.filter.FilterHandler
Parameters:
filter - (OGC WFS) Filter from (SAX) filter.