org.geotools.xml
Class XMLElementHandler

java.lang.Object
  extended byorg.geotools.xml.XMLElementHandler
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ComplexElementHandler, DocumentHandler, IgnoreHandler, SimpleElementHandler

public abstract class XMLElementHandler
extends java.lang.Object
implements java.io.Serializable

XSIElementHandler purpose.

This abstract class is intended to act as both a definition of a generic handler.

Version:
$Id: XMLElementHandler.java 17701 2006-01-23 00:00:51Z desruisseaux $
Author:
dzwiers, Refractions Research, Inc. http://www.refractions.net, $Author:$ (last modification)
See Also:
Serialized Form

Field Summary
protected static java.util.logging.Logger logger
          the logger -- should be used for debugging (assuming there are bugs LOL)
 
Constructor Summary
protected XMLElementHandler()
          Creates a new XSIElementHandler object.
 
Method Summary
 void characters(java.lang.String text)
          This method throws a SAXNotSupportedException if it is called and not overwritten.
abstract  void endElement(java.net.URI namespaceURI, java.lang.String localName, java.util.Map hints)
          handles SAX end Element events.
abstract  Element getElement()
          This returns the Element specified.
abstract  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.
abstract  java.lang.String getName()
          This returns the name of the element being represented by this handler.
abstract  java.lang.Object getValue()
          This method will get the value of the element depending on it's type.
static void setLogLevel(java.util.logging.Level l)
           Sets the logger level for all XMLElementHandlers.
abstract  void startElement(java.net.URI namespaceURI, java.lang.String localName, org.xml.sax.Attributes attr)
          handles SAX start Element events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final java.util.logging.Logger logger
the logger -- should be used for debugging (assuming there are bugs LOL)

Constructor Detail

XMLElementHandler

protected XMLElementHandler()
Creates a new XSIElementHandler object. Intended to limit creation to the sub-packages

Method Detail

characters

public void characters(java.lang.String text)
                throws org.xml.sax.SAXException
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 (

Parameters:
text -
Throws:
org.xml.sax.SAXException
org.xml.sax.SAXNotSupportedException
See Also:
endElement(String,String)).

endElement

public abstract void endElement(java.net.URI namespaceURI,
                                java.lang.String localName,
                                java.util.Map hints)
                         throws org.xml.sax.SAXException,
                                javax.naming.OperationNotSupportedException
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.

Parameters:
namespaceURI -
localName -
hints - DOCUMENT ME!
Throws:
org.xml.sax.SAXException
javax.naming.OperationNotSupportedException
See Also:
SchemaContentHandler#endElement

startElement

public abstract void startElement(java.net.URI namespaceURI,
                                  java.lang.String localName,
                                  org.xml.sax.Attributes attr)
                           throws org.xml.sax.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.

Parameters:
namespaceURI -
localName -
attr -
Throws:
org.xml.sax.SAXException
See Also:
SchemaContentHandler#startElement

getHandler

public abstract XMLElementHandler getHandler(java.net.URI namespaceURI,
                                             java.lang.String localName,
                                             java.util.Map hints)
                                      throws org.xml.sax.SAXException
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.

Parameters:
namespaceURI -
localName -
hints - DOCUMENT ME!
Returns:
XMLElementHandler, or null
Throws:
org.xml.sax.SAXException

getValue

public abstract java.lang.Object getValue()
                                   throws org.xml.sax.SAXException
This method will get the value of the element depending on it's type.

Returns:
Object (may be null)
Throws:
org.xml.sax.SAXException
See Also:
Type#getValue;

getName

public abstract java.lang.String 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

public abstract Element getElement()
This returns the Element specified.

Returns:
Element (may not be null)

setLogLevel

public static void setLogLevel(java.util.logging.Level l)

Sets the logger level for all XMLElementHandlers.

Parameters:
l -


Copyright © GeoTools. All Rights Reserved.