org.geotools.xml.handlers
Class DocumentHandler

java.lang.Object
  extended byorg.geotools.xml.XMLElementHandler
      extended byorg.geotools.xml.handlers.DocumentHandler
All Implemented Interfaces:
java.io.Serializable

public class DocumentHandler
extends XMLElementHandler

Represents the start of an XML document ... serves up elements wrapped in handlers for a specified schema.

Author:
dzwiers www.refractions.net
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_NAMESPACE_HINT_KEY
           
 
Fields inherited from class org.geotools.xml.XMLElementHandler
logger
 
Constructor Summary
DocumentHandler(ElementHandlerFactory ehf)
          Creates a new DocumentHandler object.
 
Method Summary
 void endElement(java.net.URI namespaceURI, java.lang.String localName, java.util.Map hints)
          handles SAX end Element events.
 Element getElement()
          This returns the Element specified.
 XMLElementHandler getHandler(java.net.URI namespaceURI, java.lang.String localName, java.util.Map hints)
          This will find an appropriate XMLElementHandler for the specified child if appropriate.
 java.lang.String getName()
          This returns the name of the element being represented by this handler.
 java.lang.Object getValue()
          This method will get the value of the element depending on it's type.
 void startElement(java.net.URI namespaceURI, java.lang.String localName, org.xml.sax.Attributes attr)
          handles SAX start Element events.
 
Methods inherited from class org.geotools.xml.XMLElementHandler
characters, setLogLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAMESPACE_HINT_KEY

public static final java.lang.String DEFAULT_NAMESPACE_HINT_KEY
See Also:
Constant Field Values
Constructor Detail

DocumentHandler

public DocumentHandler(ElementHandlerFactory ehf)
Creates a new DocumentHandler object.

Parameters:
ehf - ElementHandlerFactory
Method Detail

getElement

public Element getElement()
Description copied from class: XMLElementHandler
This returns the Element specified.

Specified by:
getElement in class XMLElementHandler
Returns:
Element (may not be null)
See Also:
XMLElementHandler.getElement()

endElement

public void endElement(java.net.URI namespaceURI,
                       java.lang.String localName,
                       java.util.Map hints)
Description copied from class: XMLElementHandler
handles SAX end Element events. This matches the end of the element declaration in the document ... and responds to the event generated by the SAX parser. This is an opportunity to complete some post-processing.

Specified by:
endElement in class XMLElementHandler
Parameters:
namespaceURI -
localName -
hints - DOCUMENT ME!
See Also:
org.geotools.xml.XMLElementHandler#endElement(java.lang.String, java.lang.String)

getHandler

public XMLElementHandler getHandler(java.net.URI namespaceURI,
                                    java.lang.String localName,
                                    java.util.Map hints)
                             throws org.xml.sax.SAXException
Description copied from class: XMLElementHandler
This will find an appropriate XMLElementHandler for the specified child if appropriate. This method may return or throw an exception, depending on the severity, if an error occurs. This method should be used to complete a SAX parse of a document for which the Schema is known, and parsed.

Specified by:
getHandler in class XMLElementHandler
Parameters:
namespaceURI -
localName -
hints - DOCUMENT ME!
Returns:
XMLElementHandler, or null
Throws:
org.xml.sax.SAXException
See Also:
org.geotools.xml.XMLElementHandler#getHandler(java.lang.String, java.lang.String)

startElement

public void startElement(java.net.URI namespaceURI,
                         java.lang.String localName,
                         org.xml.sax.Attributes attr)
Description copied from class: XMLElementHandler
handles SAX start Element events. This matches the start of the element declaration in the document ... and responds to the event generated by the SAX parser. This is an opportunity to complete some pre-processing.

Specified by:
startElement in class XMLElementHandler
Parameters:
namespaceURI -
localName -
attr -
See Also:
org.geotools.xml.XMLElementHandler#startElement(java.lang.String, java.lang.String, org.xml.sax.Attributes)

getValue

public java.lang.Object getValue()
                          throws org.xml.sax.SAXException
Description copied from class: XMLElementHandler
This method will get the value of the element depending on it's type.

Specified by:
getValue in class XMLElementHandler
Returns:
Object (may be null)
Throws:
org.xml.sax.SAXException
See Also:
XMLElementHandler.getValue()

getName

public java.lang.String getName()
Description copied from class: XMLElementHandler
This returns the name of the element being represented by this handler. This name matches the name specified in the Schema.

Specified by:
getName in class XMLElementHandler
Returns:
The Name (may not be null)
See Also:
XMLElementHandler.getName()


Copyright © GeoTools. All Rights Reserved.