Devsphere.com


com.devsphere.xml.saxdomix.helpers
Class DefaultSDXHelperT

java.lang.Object
  |
  +--com.devsphere.xml.saxdomix.helpers.DefaultSDXOldHelper
        |
        +--com.devsphere.xml.saxdomix.helpers.DefaultSDXHelper
              |
              +--com.devsphere.xml.saxdomix.helpers.DefaultSDXHelperT
All Implemented Interfaces:
SDXHelper, SDXHelperT, SDXOldHelper

public class DefaultSDXHelperT
extends DefaultSDXHelper
implements SDXHelperT

This default factory for DOM sub-trees called helper is used by SDXBuilderT.

See Also:
SDXBuilderT, SDXHelperT

Field Summary
protected  javax.xml.transform.sax.TransformerHandler parser
          Takes SAX events as input and produces a DOM sub-tree
protected  javax.xml.transform.dom.DOMResult result
          Container for the current DOM sub-tree
protected static javax.xml.transform.sax.SAXTransformerFactory traxFactory
          Factory for TransformerHandler objects
 
Fields inherited from class com.devsphere.xml.saxdomix.helpers.DefaultSDXOldHelper
document, jaxpBuilder, jaxpFactory
 
Constructor Summary
DefaultSDXHelperT()
          Creates a new helper.
 
Method Summary
protected  org.w3c.dom.DocumentFragment createDocumentFragment()
          Creates a DOM DocumentFragment node
 org.w3c.dom.Element endBuilding()
          This method must be called after the dispatching of the last SAX event of the sequence that was used for building the current DOM sub-tree.
 org.xml.sax.ContentHandler getContentHandler()
          Returns the SAX ContentHandler that should receive the events between startBuilding() and endBuilding().
 org.xml.sax.ext.LexicalHandler getLexicalHandler()
          Returns the SAX LexicalHandler that should receive the events between startBuilding() and endBuilding().
 void startBuilding()
          Prepares this helper for building a DOM sub-tree from SAX events.
 
Methods inherited from class com.devsphere.xml.saxdomix.helpers.DefaultSDXHelper
createCDATASection, createComment, createElement
 
Methods inherited from class com.devsphere.xml.saxdomix.helpers.DefaultSDXOldHelper
createElement, createProcessingInstruction, createTextNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.devsphere.xml.saxdomix.helpers.SDXHelper
createProcessingInstruction, createTextNode
 

Field Detail

traxFactory

protected static javax.xml.transform.sax.SAXTransformerFactory traxFactory
Factory for TransformerHandler objects


parser

protected javax.xml.transform.sax.TransformerHandler parser
Takes SAX events as input and produces a DOM sub-tree


result

protected javax.xml.transform.dom.DOMResult result
Container for the current DOM sub-tree

Constructor Detail

DefaultSDXHelperT

public DefaultSDXHelperT()
Creates a new helper.

Method Detail

createDocumentFragment

protected org.w3c.dom.DocumentFragment createDocumentFragment()
Creates a DOM DocumentFragment node

Returns:
The created DOM DocumentFragment

startBuilding

public void startBuilding()
                   throws org.xml.sax.SAXException
Prepares this helper for building a DOM sub-tree from SAX events. After calling this method, the user of this class may feed the ContentHandler and LexicalHandler with SAX events. Then, the endBuilding() method must be called in order to obtain the root of the created DOM sub-tree.

Specified by:
startBuilding in interface SDXHelperT
Throws:
org.xml.sax.SAXException - If an error must be signaled

endBuilding

public org.w3c.dom.Element endBuilding()
                                throws org.xml.sax.SAXException
This method must be called after the dispatching of the last SAX event of the sequence that was used for building the current DOM sub-tree. The SAX handlers may not receive events until the next call of startBuilding(), which will mark the beginning of the construction of another DOM sub-tree.

Specified by:
endBuilding in interface SDXHelperT
Returns:
The root of the created DOM sub-tree
Throws:
org.xml.sax.SAXException - If an error must be signaled

getContentHandler

public org.xml.sax.ContentHandler getContentHandler()
Returns the SAX ContentHandler that should receive the events between startBuilding() and endBuilding().

Specified by:
getContentHandler in interface SDXHelperT
Returns:
The ContentHandler of this helper

getLexicalHandler

public org.xml.sax.ext.LexicalHandler getLexicalHandler()
Returns the SAX LexicalHandler that should receive the events between startBuilding() and endBuilding().

Specified by:
getLexicalHandler in interface SDXHelperT
Returns:
The LexicalHandler of this helper

 Devsphere.com