org.apache.ws.jaxme.xs.parser
Class DOMBuilder

java.lang.Object
  extended by org.apache.ws.jaxme.xs.parser.DOMBuilder
All Implemented Interfaces:
org.xml.sax.ContentHandler

public class DOMBuilder
extends java.lang.Object
implements org.xml.sax.ContentHandler

Converts a stream of SAX events into a DOM node.

Version:
$Id$
Author:
Jochen Wiedmann

Constructor Summary
DOMBuilder()
          Creates a new instance of DOMBuilder, which creates a new document.
DOMBuilder(org.w3c.dom.Node pTarget)
          Creates a new instance of DOMBuilder, which creates a new element node in the given node.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
           
 void endPrefixMapping(java.lang.String prefix)
           
 org.w3c.dom.Document getDocument()
          Returns the document being used as object factory.
 org.xml.sax.Locator getDocumentLocator()
          Returns the Locator.
 org.w3c.dom.Element getResult()
          Returns the result element.
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void processingInstruction(java.lang.String pTarget, java.lang.String pData)
           
 void setDocumentLocator(org.xml.sax.Locator pLocator)
          Sets the Locator.
 void skippedEntity(java.lang.String pName)
           
 void startDocument()
           
 void startElement(java.lang.String pNamespaceURI, java.lang.String pLocalName, java.lang.String pQName, org.xml.sax.Attributes pAttr)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMBuilder

public DOMBuilder()
           throws javax.xml.parsers.ParserConfigurationException

Creates a new instance of DOMBuilder, which creates a new document. The document is available via getDocument().

Throws:
javax.xml.parsers.ParserConfigurationException

DOMBuilder

public DOMBuilder(org.w3c.dom.Node pTarget)

Creates a new instance of DOMBuilder, which creates a new element node in the given node. The created node is available via getResult().

Method Detail

getDocument

public org.w3c.dom.Document getDocument()

Returns the document being used as object factory. In the case of the empty constructor, this is a new document. Otherwise it is the target nodes owner document.


getResult

public org.w3c.dom.Element getResult()

Returns the result element. In the case of the default constructor, this is the document element. Otherwise it is added to the target node via Node.appendChild(org.w3c.dom.Node).<(p>


setDocumentLocator

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

Sets the Locator.

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler

getDocumentLocator

public org.xml.sax.Locator getDocumentLocator()

Returns the Locator.


startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.startDocument()

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.endDocument()

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String pNamespaceURI,
                         java.lang.String pLocalName,
                         java.lang.String pQName,
                         org.xml.sax.Attributes pAttr)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endElement

public 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
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String pTarget,
                                  java.lang.String pData)
                           throws org.xml.sax.SAXException
Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

skippedEntity

public void skippedEntity(java.lang.String pName)
                   throws org.xml.sax.SAXException
Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException