org.geotools.xml
Class XMLSAXHandler

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.geotools.xml.XMLSAXHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class XMLSAXHandler
extends org.xml.sax.helpers.DefaultHandler

XMLSAXHandler purpose.

This is a schema content handler. Code here has been modified from code written by Ian Schneider.

This class contains one stack used to store part of the parse tree. The ElementHandlers found on the stack have direct next handlers placed on the stack. So here's the warning, be careful to read how you may be affecting (or forgetting to affect) the stack.

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

Field Summary
protected static java.util.logging.Level level
           
protected static java.util.logging.Logger logger
          the logger -- should be used for debugging (assuming there are bugs LOL)
 
Constructor Summary
XMLSAXHandler(java.util.Map hints)
           This contructor is intended to create an XMLSAXHandler to be used when parsing an XML instance document.
XMLSAXHandler(java.net.URI intendedDocument, java.util.Map hints)
           This contructor is intended to create an XMLSAXHandler to be used when parsing an XML instance document.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Implementation of characters.
 void endDocument()
          Implementation of endDocument.
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
          Implementation of endElement.
 void endPrefixMapping(java.lang.String prefix)
           
 void error(org.xml.sax.SAXParseException exception)
          Implementation of error.
 void fatalError(org.xml.sax.SAXParseException exception)
          Implementation of fatalError.
 java.lang.Object getDocument()
          getDocument purpose.
 org.xml.sax.InputSource resolveEntity(java.lang.String pubId, java.lang.String sysId)
          TODO summary sentence for resolveEntity ...
 void setDocumentLocator(org.xml.sax.Locator locator)
          Stores the locator for future error reporting
static void setLogLevel(java.util.logging.Level l)
           Used to set the logger level for all XMLSAXHandlers
 void startDocument()
          Implementation of startDocument.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Implementation of startElement.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 void warning(org.xml.sax.SAXParseException exception)
          Implementation of warning.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
ignorableWhitespace, notationDecl, processingInstruction, skippedEntity, unparsedEntityDecl
 
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)


level

protected static java.util.logging.Level level
Constructor Detail

XMLSAXHandler

public XMLSAXHandler(java.net.URI intendedDocument,
                     java.util.Map hints)

This contructor is intended to create an XMLSAXHandler to be used when parsing an XML instance document. The instance document's uri is also be provided, as this will allow the parser to resolve relative uri's.

Parameters:
intendedDocument -
hints - DOCUMENT ME!

XMLSAXHandler

public XMLSAXHandler(java.util.Map hints)

This contructor is intended to create an XMLSAXHandler to be used when parsing an XML instance document. The instance document's uri is also be provided, as this will allow the parser to resolve relative uri's.

Parameters:
hints - DOCUMENT ME!
Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String pubId,
                                             java.lang.String sysId)
                                      throws org.xml.sax.SAXException
TODO summary sentence for resolveEntity ...

Parameters:
pubId -
sysId -
Returns:
InputSource
Throws:
org.xml.sax.SAXException
See Also:
EntityResolver.resolveEntity(java.lang.String, java.lang.String)

endDocument

public void endDocument()
Implementation of endDocument.

See Also:
ContentHandler.endDocument()

startDocument

public void startDocument()
Implementation of startDocument.

See Also:
ContentHandler.startDocument()

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Implementation of characters.

Parameters:
ch -
start -
length -
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.characters(char[], int, int)

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Implementation of endElement.

Parameters:
namespaceURI -
localName -
qName -
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Implementation of startElement.

Parameters:
namespaceURI -
localName -
qName -
atts -
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

setLogLevel

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

Used to set the logger level for all XMLSAXHandlers

Parameters:
l -

getDocument

public java.lang.Object getDocument()
                             throws org.xml.sax.SAXException
getDocument purpose.

Completes the post-processing phase, and returns the value from the parse ...

Returns:
Object parsed
Throws:
org.xml.sax.SAXException
See Also:
DocumentHandler.getValue()

error

public void error(org.xml.sax.SAXParseException exception)
Implementation of error.

Parameters:
exception -
See Also:
ErrorHandler.error(org.xml.sax.SAXParseException)

fatalError

public void fatalError(org.xml.sax.SAXParseException exception)
                throws org.xml.sax.SAXException
Implementation of fatalError.

Parameters:
exception -
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException)

warning

public void warning(org.xml.sax.SAXParseException exception)
Implementation of warning.

Parameters:
exception -
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException)

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Stores the locator for future error reporting

See Also:
ContentHandler.setDocumentLocator(org.xml.sax.Locator)

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
See Also:
ContentHandler.endPrefixMapping(java.lang.String)

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
See Also:
ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)


Copyright © GeoTools. All Rights Reserved.