Package org.geotools.xml
Class XMLElementHandler
Object
XMLElementHandler
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ComplexElementHandler
,DocumentHandler
,IgnoreHandler
,SimpleElementHandler
Intended to act as both a definition and a generic handler.
- Author:
- dzwiers, Refractions Research, Inc. http://www.refractions.net, $Author:$ (last modification)
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new XSIElementHandler object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(String text) This method throws a SAXNotSupportedException if it is called and not overwritten.abstract void
handles SAX end Element events.abstract Element
This returns the Element specified.abstract XMLElementHandler
This will find an appropriate XMLElementHandler for the specified child if appropriate.abstract String
getName()
This returns the name of the element being represented by this handler.abstract Object
getValue()
This method will get the value of the element depending on it's type.static void
setLogLevel
(Level l) Sets the logger level for all XMLElementHandlers.abstract void
startElement
(URI namespaceURI, String localName, Attributes attr) handles SAX start Element events.
-
Field Details
-
logger
the logger -- should be used for debugging (assuming there are bugs LOL)
-
-
Constructor Details
-
XMLElementHandler
protected XMLElementHandler()Creates a new XSIElementHandler object. Intended to limit creation to the sub-packages
-
-
Method Details
-
characters
This method throws a SAXNotSupportedException if it is called and not overwritten. When overridding this method, you should be careful to understand that it may be called more than once per element. Therefore it would be advisable to log the text and handle the text's interpretation at a later time (- Throws:
SAXException
-
endElement
public abstract void endElement(URI namespaceURI, String localName, Map<String, Object> hints) throws SAXException, OperationNotSupportedExceptionhandles 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.- Throws:
SAXException
OperationNotSupportedException
- See Also:
-
SchemaContentHandler#endElement
-
startElement
public abstract void startElement(URI namespaceURI, String localName, Attributes attr) throws SAXException 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.- Throws:
SAXException
- See Also:
-
SchemaContentHandler#startElement
-
getHandler
public abstract XMLElementHandler getHandler(URI namespaceURI, String localName, Map<String, Object> hints) throws SAXExceptionThis 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.- Returns:
- XMLElementHandler, or null
- Throws:
SAXException
-
getValue
This method will get the value of the element depending on it's type.- Returns:
- Object (may be null)
- Throws:
SAXException
- See Also:
-
Type#getValue
-
getName
This returns the name of the element being represented by this handler. This name matches the name specified in the Schema.- Returns:
- The Name (may not be null)
-
getElement
This returns the Element specified.- Returns:
- Element (may not be null)
-
setLogLevel
Sets the logger level for all XMLElementHandlers.
-