org.objectweb.asm.xml
Class Processor.InputSlicingHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.objectweb.asm.xml.Processor.InputSlicingHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
Enclosing class:
Processor

private static final class Processor.InputSlicingHandler
extends org.xml.sax.helpers.DefaultHandler

A ContentHandler that splits XML documents into smaller chunks. Each chunk is processed by the nested ContentHandler obtained from ContentHandlerFactory. This is useful for running XSLT engine against large XML document that will hardly fit into the memory all together.

TODO use complete path for subdocumentRoot


Field Summary
private  org.xml.sax.ContentHandler rootHandler
           
private  boolean subdocument
           
private  org.xml.sax.ContentHandler subdocumentHandler
           
private  Processor.ContentHandlerFactory subdocumentHandlerFactory
           
private  java.lang.String subdocumentRoot
           
 
Constructor Summary
Processor.InputSlicingHandler(java.lang.String subdocumentRoot, org.xml.sax.ContentHandler rootHandler, Processor.ContentHandlerFactory subdocumentHandlerFactory)
          Constructs a new SubdocumentHandler object.
 
Method Summary
 void characters(char[] buff, int offset, int size)
           
 void endDocument()
           
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
           
 void startDocument()
           
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes list)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subdocumentRoot

private java.lang.String subdocumentRoot

rootHandler

private org.xml.sax.ContentHandler rootHandler

subdocumentHandlerFactory

private Processor.ContentHandlerFactory subdocumentHandlerFactory

subdocument

private boolean subdocument

subdocumentHandler

private org.xml.sax.ContentHandler subdocumentHandler
Constructor Detail

Processor.InputSlicingHandler

public Processor.InputSlicingHandler(java.lang.String subdocumentRoot,
                                     org.xml.sax.ContentHandler rootHandler,
                                     Processor.ContentHandlerFactory subdocumentHandlerFactory)
Constructs a new SubdocumentHandler object.

Parameters:
subdocumentRoot - name/path to the root element of the subdocument
rootHandler - content handler for the entire document (subdocument envelope).
subdocumentHandlerFactory - a ContentHandlerFactory used to create ContentHandler instances for subdocuments.
Method Detail

startElement

public final void startElement(java.lang.String namespaceURI,
                               java.lang.String localName,
                               java.lang.String qName,
                               org.xml.sax.Attributes list)
                        throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public final void endElement(java.lang.String namespaceURI,
                             java.lang.String localName,
                             java.lang.String qName)
                      throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

startDocument

public final void startDocument()
                         throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endDocument

public final void endDocument()
                       throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

characters

public final void characters(char[] buff,
                             int offset,
                             int size)
                      throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException