Package org.geotools.xml.handlers
Class DocumentHandler
- Object
-
- XMLElementHandler
-
- DocumentHandler
-
- All Implemented Interfaces:
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
Fields Modifier and Type Field Description static String
DEFAULT_NAMESPACE_HINT_KEY
SuppliedSchema
for parsing and validation-
Fields inherited from class XMLElementHandler
logger
-
-
Constructor Summary
Constructors Constructor Description DocumentHandler(ElementHandlerFactory ehf)
Creates a new DocumentHandler object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endElement(URI namespaceURI, String localName, Map<String,Object> hints)
handles SAX end Element events.Element
getElement()
This returns the Element specified.XMLElementHandler
getHandler(URI namespaceURI, String localName, Map<String,Object> hints)
This will find an appropriate XMLElementHandler for the specified child if appropriate.String
getName()
This returns the name of the element being represented by this handler.Object
getValue()
This method will get the value of the element depending on it's type.void
startElement(URI namespaceURI, String localName, Attributes attr)
handles SAX start Element events.-
Methods inherited from class XMLElementHandler
characters, setLogLevel
-
-
-
-
Field Detail
-
DEFAULT_NAMESPACE_HINT_KEY
public static final String DEFAULT_NAMESPACE_HINT_KEY
SuppliedSchema
for parsing and validation- 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 classXMLElementHandler
- Returns:
- Element (may not be null)
- See Also:
XMLElementHandler.getElement()
-
endElement
public void endElement(URI namespaceURI, String localName, Map<String,Object> 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 classXMLElementHandler
- See Also:
org.geotools.xml.XMLElementHandler#endElement(java.lang.String, java.lang.String)
-
getHandler
public XMLElementHandler getHandler(URI namespaceURI, String localName, Map<String,Object> hints) throws 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 classXMLElementHandler
- Returns:
- XMLElementHandler, or null
- Throws:
SAXException
- See Also:
org.geotools.xml.XMLElementHandler#getHandler(java.lang.String, java.lang.String)
-
startElement
public void startElement(URI namespaceURI, String localName, 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 classXMLElementHandler
- See Also:
org.geotools.xml.XMLElementHandler#startElement(java.lang.String, java.lang.String, org.xml.sax.Attributes)
-
getValue
public Object getValue() throws SAXException
Description copied from class:XMLElementHandler
This method will get the value of the element depending on it's type.- Specified by:
getValue
in classXMLElementHandler
- Returns:
- Object (may be null)
- Throws:
SAXException
- See Also:
XMLElementHandler.getValue()
-
getName
public 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 classXMLElementHandler
- Returns:
- The Name (may not be null)
- See Also:
XMLElementHandler.getName()
-
-