com.sun.xml.bind.marshaller
Class SAX2DOMEx

java.lang.Object
  extended by com.sun.xml.bind.marshaller.SAX2DOMEx
All Implemented Interfaces:
ContentHandler

public class SAX2DOMEx
extends Object
implements ContentHandler

Builds a DOM tree from SAX2 events.

Since:
1.0
Author:
Vivek Pandey

Field Summary
protected  Document document
          Document object that owns the specified node.
protected  Stack<Node> nodeStack
           
 
Constructor Summary
SAX2DOMEx()
          Deprecated.  
SAX2DOMEx(DocumentBuilderFactory f)
          Creates a fresh empty DOM document and adds nodes under this document.
SAX2DOMEx(Node node)
           
SAX2DOMEx(Node node, boolean isConsolidate)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
protected  Text characters(String s)
           
 void endDocument()
           
 void endElement(String namespace, String localName, String qName)
           
 void endPrefixMapping(String prefix)
           
 Element getCurrentElement()
           
 Node getDOM()
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
protected  void namespace(Element element, String prefix, String uri)
           
 void processingInstruction(String target, String data)
           
 void setDocumentLocator(Locator locator)
           
 void skippedEntity(String name)
           
 void startDocument()
           
 void startElement(String namespace, String localName, String qName, Attributes attrs)
           
 void startPrefixMapping(String prefix, String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeStack

protected final Stack<Node> nodeStack

document

protected final Document document
Document object that owns the specified node.

Constructor Detail

SAX2DOMEx

public SAX2DOMEx(Node node)
Parameters:
node - Nodes will be created and added under this object.

SAX2DOMEx

public SAX2DOMEx(Node node,
                 boolean isConsolidate)
Parameters:
node - Nodes will be created and added under this object.

SAX2DOMEx

public SAX2DOMEx(DocumentBuilderFactory f)
          throws ParserConfigurationException
Creates a fresh empty DOM document and adds nodes under this document.

Throws:
ParserConfigurationException

SAX2DOMEx

public SAX2DOMEx()
          throws ParserConfigurationException
Deprecated. 

Creates a fresh empty DOM document and adds nodes under this document.

Throws:
ParserConfigurationException
Method Detail

getCurrentElement

public final Element getCurrentElement()

getDOM

public Node getDOM()

startDocument

public void startDocument()
Specified by:
startDocument in interface ContentHandler

endDocument

public void endDocument()
Specified by:
endDocument in interface ContentHandler

namespace

protected void namespace(Element element,
                         String prefix,
                         String uri)

startElement

public void startElement(String namespace,
                         String localName,
                         String qName,
                         Attributes attrs)
Specified by:
startElement in interface ContentHandler

endElement

public void endElement(String namespace,
                       String localName,
                       String qName)
Specified by:
endElement in interface ContentHandler

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface ContentHandler

characters

protected Text characters(String s)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
Specified by:
ignorableWhitespace in interface ContentHandler

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
Throws:
SAXException

setDocumentLocator

public void setDocumentLocator(Locator locator)
Specified by:
setDocumentLocator in interface ContentHandler

skippedEntity

public void skippedEntity(String name)
Specified by:
skippedEntity in interface ContentHandler

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
Specified by:
startPrefixMapping in interface ContentHandler

endPrefixMapping

public void endPrefixMapping(String prefix)
Specified by:
endPrefixMapping in interface ContentHandler


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.