net.sf.stax
Class StAXContentHandlerBase

java.lang.Object
  extended by net.sf.stax.StAXContentHandlerBase
All Implemented Interfaces:
StAXContentHandler
Direct Known Subclasses:
BooleanElementHandler, ByteElementHandler, CharElementHandler, DispatchForChild, DispatchOnElement, DoubleElementHandler, FloatElementHandler, IntElementHandler, LongElementHandler, StringElementHandler

public class StAXContentHandlerBase
extends Object
implements StAXContentHandler

Simple implementation of the StAXContentHandler interface, with empty implementations for all the methods.

This class is provided as a base for content handlers where the implementor does not wish to provide all the methods.

Version:
$Revision: 1.3 $ $Date: 2006/01/02 20:37:34 $
Author:
Thomas Down, Michael Heuer

Field Summary
 
Fields inherited from interface net.sf.stax.StAXContentHandler
IGNORE
 
Constructor Summary
StAXContentHandlerBase()
           
 
Method Summary
 void characters(char[] ch, int start, int length, StAXContext ctx)
          Receive notification of character data.
 void endElement(String nsURI, String localName, String qName, Object result, StAXContext ctx)
          Receive notification of the end of an element.
 void endPrefixMapping(String prefix, StAXContext ctx)
          End the scope of a prefix-URI mapping.
 Object endTree(StAXContext ctx)
          Receive notification of the end of a sub-tree of a document.
 void ignorableWhitespace(char[] ch, int start, int length, StAXContext ctx)
          Receive notification of ignorable whitespace in element content.
 void processingInstruction(String target, String data, StAXContext ctx)
          Receive notification of a processing instruction.
 void setDocumentLocator(Locator locator, StAXContext ctx)
          Receive an object for locating the origin of SAX document events.
 void skippedEntity(String name, StAXContext ctx)
          Receive notification of a skipped entity.
 void startElement(String nsURI, String localName, String qName, Attributes attrs, StAXDelegationContext dctx)
          Receive notification of the beginning of an element.
 void startPrefixMapping(String prefix, String uri, StAXContext ctx)
          Begin the score of a prefix-URI Namespace mapping.
 void startTree(StAXContext ctx)
          Receive notification of the beginning of a sub-tree of a document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StAXContentHandlerBase

public StAXContentHandlerBase()
Method Detail

startTree

public void startTree(StAXContext ctx)
               throws SAXException
Description copied from interface: StAXContentHandler
Receive notification of the beginning of a sub-tree of a document.

Specified by:
startTree in interface StAXContentHandler
Parameters:
ctx - StAX context
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler

endTree

public Object endTree(StAXContext ctx)
               throws SAXException
Description copied from interface: StAXContentHandler
Receive notification of the end of a sub-tree of a document.

Specified by:
endTree in interface StAXContentHandler
Parameters:
ctx - StAX context
Returns:
return value
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler

characters

public void characters(char[] ch,
                       int start,
                       int length,
                       StAXContext ctx)
                throws SAXException
Description copied from interface: StAXContentHandler
Receive notification of character data.

Specified by:
characters in interface StAXContentHandler
Parameters:
ch - characters from the XML document
start - start position in the array
length - number of characters to read from the array
ctx - StAX context
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length,
                                StAXContext ctx)
                         throws SAXException
Description copied from interface: StAXContentHandler
Receive notification of ignorable whitespace in element content.

Specified by:
ignorableWhitespace in interface StAXContentHandler
Parameters:
ch - characters from the XML document
start - start position in the array
length - number of characters to read from the array
ctx - StAX context
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri,
                               StAXContext ctx)
                        throws SAXException
Description copied from interface: StAXContentHandler
Begin the score of a prefix-URI Namespace mapping.

Specified by:
startPrefixMapping in interface StAXContentHandler
Parameters:
prefix - namespace prefix being declared
uri - namespace URI the prefix is mapped to
ctx - StAX context
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler

endPrefixMapping

public void endPrefixMapping(String prefix,
                             StAXContext ctx)
                      throws SAXException
Description copied from interface: StAXContentHandler
End the scope of a prefix-URI mapping.

Specified by:
endPrefixMapping in interface StAXContentHandler
Parameters:
prefix - prefix that was being mapped
ctx - StAX context
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler

processingInstruction

public void processingInstruction(String target,
                                  String data,
                                  StAXContext ctx)
                           throws SAXException
Description copied from interface: StAXContentHandler
Receive notification of a processing instruction.

Specified by:
processingInstruction in interface StAXContentHandler
Parameters:
target - processing instruction target
data - processing instruction data
ctx - StAX context
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler

setDocumentLocator

public void setDocumentLocator(Locator locator,
                               StAXContext ctx)
Description copied from interface: StAXContentHandler
Receive an object for locating the origin of SAX document events.

Specified by:
setDocumentLocator in interface StAXContentHandler
Parameters:
locator - an object that can return the location of any SAX document event
ctx - StAX context
See Also:
StAXContentHandler

skippedEntity

public void skippedEntity(String name,
                          StAXContext ctx)
                   throws SAXException
Description copied from interface: StAXContentHandler
Receive notification of a skipped entity.

Specified by:
skippedEntity in interface StAXContentHandler
Parameters:
name - name of the skipped entity
ctx - StAX context
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler

startElement

public void startElement(String nsURI,
                         String localName,
                         String qName,
                         Attributes attrs,
                         StAXDelegationContext dctx)
                  throws SAXException
Description copied from interface: StAXContentHandler
Receive notification of the beginning of an element.

Specified by:
startElement in interface StAXContentHandler
Parameters:
nsURI - namespace URI
localName - local name (without prefix)
qName - qualified XML name (with prefix)
attrs - attributes attached to the element
dctx - StAX delegation context
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler

endElement

public void endElement(String nsURI,
                       String localName,
                       String qName,
                       Object result,
                       StAXContext ctx)
                throws SAXException
Description copied from interface: StAXContentHandler
Receive notification of the end of an element.

Specified by:
endElement in interface StAXContentHandler
Parameters:
nsURI - namespace URI
localName - local name (without prefix)
qName - qualified XML name (with prefix)
result - result
ctx - StAX context
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
StAXContentHandler


Copyright (c) 2001-2006 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).