org.springframework.xml.stream
Class StaxEventContentHandler

java.lang.Object
  extended by org.springframework.xml.stream.AbstractStaxContentHandler
      extended by org.springframework.xml.stream.StaxEventContentHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler

public class StaxEventContentHandler
extends AbstractStaxContentHandler

SAX ContentHandler that transforms callback calls to XMLEvents and writes them to a XMLEventConsumer.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
XMLEvent, XMLEventConsumer

Constructor Summary
StaxEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer)
          Constructs a new instance of the StaxEventContentHandler that writes to the given XMLEventConsumer.
StaxEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer, javax.xml.stream.XMLEventFactory factory)
          Constructs a new instance of the StaxEventContentHandler that uses the given event factory to create events and writes to the given XMLEventConsumer.
 
Method Summary
protected  void charactersInternal(char[] ch, int start, int length)
           
protected  void endDocumentInternal()
           
protected  void endElementInternal(javax.xml.namespace.QName name, SimpleNamespaceContext namespaceContext)
           
protected  void ignorableWhitespaceInternal(char[] ch, int start, int length)
           
protected  void processingInstructionInternal(String target, String data)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
protected  void skippedEntityInternal(String name)
           
protected  void startDocumentInternal()
           
protected  void startElementInternal(javax.xml.namespace.QName name, org.xml.sax.Attributes atts, SimpleNamespaceContext namespaceContext)
           
 
Methods inherited from class org.springframework.xml.stream.AbstractStaxContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaxEventContentHandler

public StaxEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer)
Constructs a new instance of the StaxEventContentHandler that writes to the given XMLEventConsumer. A default XMLEventFactory will be created.

Parameters:
consumer - the consumer to write events to

StaxEventContentHandler

public StaxEventContentHandler(javax.xml.stream.util.XMLEventConsumer consumer,
                               javax.xml.stream.XMLEventFactory factory)
Constructs a new instance of the StaxEventContentHandler that uses the given event factory to create events and writes to the given XMLEventConsumer.

Parameters:
consumer - the consumer to write events to
factory - the factory used to create events
Method Detail

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)

startDocumentInternal

protected void startDocumentInternal()
                              throws javax.xml.stream.XMLStreamException
Specified by:
startDocumentInternal in class AbstractStaxContentHandler
Throws:
javax.xml.stream.XMLStreamException

endDocumentInternal

protected void endDocumentInternal()
                            throws javax.xml.stream.XMLStreamException
Specified by:
endDocumentInternal in class AbstractStaxContentHandler
Throws:
javax.xml.stream.XMLStreamException

startElementInternal

protected void startElementInternal(javax.xml.namespace.QName name,
                                    org.xml.sax.Attributes atts,
                                    SimpleNamespaceContext namespaceContext)
                             throws javax.xml.stream.XMLStreamException
Specified by:
startElementInternal in class AbstractStaxContentHandler
Throws:
javax.xml.stream.XMLStreamException

endElementInternal

protected void endElementInternal(javax.xml.namespace.QName name,
                                  SimpleNamespaceContext namespaceContext)
                           throws javax.xml.stream.XMLStreamException
Specified by:
endElementInternal in class AbstractStaxContentHandler
Throws:
javax.xml.stream.XMLStreamException

charactersInternal

protected void charactersInternal(char[] ch,
                                  int start,
                                  int length)
                           throws javax.xml.stream.XMLStreamException
Specified by:
charactersInternal in class AbstractStaxContentHandler
Throws:
javax.xml.stream.XMLStreamException

ignorableWhitespaceInternal

protected void ignorableWhitespaceInternal(char[] ch,
                                           int start,
                                           int length)
                                    throws javax.xml.stream.XMLStreamException
Specified by:
ignorableWhitespaceInternal in class AbstractStaxContentHandler
Throws:
javax.xml.stream.XMLStreamException

processingInstructionInternal

protected void processingInstructionInternal(String target,
                                             String data)
                                      throws javax.xml.stream.XMLStreamException
Specified by:
processingInstructionInternal in class AbstractStaxContentHandler
Throws:
javax.xml.stream.XMLStreamException

skippedEntityInternal

protected void skippedEntityInternal(String name)
                              throws javax.xml.stream.XMLStreamException
Specified by:
skippedEntityInternal in class AbstractStaxContentHandler
Throws:
javax.xml.stream.XMLStreamException


Copyright © 2010. All Rights Reserved.