Package eu.bandm.tools.util.xml
Class SAX2DOMConverter
java.lang.Object
eu.bandm.tools.util.xml.SAX2DOMConverter
- All Implemented Interfaces:
ContentHandler
De-Serializes a document given by a sequence of SAX calls
into a static
Usage sequence: (1) call
(2) call
(For instance fetched from
(3) send SAX events to sdc
(4) finally call
w3c dom
representation
(in some local implementation, accessed via the JAXP architecture).
Usage sequence: (1) call
sdc = new SAX2DOMConverter()
(2) call
sdc.setDOMImplementation(DOMImplementation)
(For instance fetched from
javax.xml.parsers.DocumentBuilderFactory
.newInstance().newDocumentBuilder().getDOMImplementation()
(3) send SAX events to sdc
(4) finally call
sdc.getDocument()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] data, int start, int length) evidentvoid
Is ignored by this implementation.void
endElement
(String namespaceURI, String localName, String qName) evidentvoid
endPrefixMapping
(String prefix) Is ignored by this implementation.Deliver the generated dom document.Delivers the system-dependent factory which will deliver the dom object, as set explicitly by a call tosetDOMImplementation(org.w3c.dom.DOMImplementation)
.void
ignorableWhitespace
(char[] data, int start, int length) Is ignored by this implementation.void
processingInstruction
(String target, String text) Is ignored by this implementation.void
setDocumentLocator
(Locator locator) Is ignored by this implementation.void
setDocumentURI
(String documentUri) Set the document URI.void
setDOMImplementation
(DOMImplementation domImpl) Sets the system-dependent factory which will deliver the dom object.void
skippedEntity
(String name) Is ignored by this implementation.void
Creates a new document.void
startElement
(String namespaceURI, String localName, String qName, Attributes attrs) evidentvoid
startPrefixMapping
(String prefix, String namespaceURI) Is ignored by this implementation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
SAX2DOMConverter
public SAX2DOMConverter()
-
-
Method Details
-
setDOMImplementation
Sets the system-dependent factory which will deliver the dom object. -
getDOMImplementation
Delivers the system-dependent factory which will deliver the dom object, as set explicitly by a call tosetDOMImplementation(org.w3c.dom.DOMImplementation)
. -
startDocument
public void startDocument()Creates a new document. No topeleve element ("document element") is created. This is left to the first "open" Sax event.- Specified by:
startDocument
in interfaceContentHandler
-
setDocumentURI
Set the document URI. The value goes directly toDocument
and thus is the basis for calculating all relative uris contained in this document. May only be called once for each instance, before or afterstartDocument()
. -
getDocument
Deliver the generated dom document. Sensibly called not before the last SAX event has been received. -
startElement
evident- Specified by:
startElement
in interfaceContentHandler
-
endElement
evident- Specified by:
endElement
in interfaceContentHandler
-
characters
public void characters(char[] data, int start, int length) evident- Specified by:
characters
in interfaceContentHandler
-
endDocument
public void endDocument()Is ignored by this implementation.- Specified by:
endDocument
in interfaceContentHandler
-
endPrefixMapping
Is ignored by this implementation. All sax events are assumed to contain complete and consistent namespace information (URI, localname, qname).- Specified by:
endPrefixMapping
in interfaceContentHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] data, int start, int length) Is ignored by this implementation.- Specified by:
ignorableWhitespace
in interfaceContentHandler
-
processingInstruction
Is ignored by this implementation.- Specified by:
processingInstruction
in interfaceContentHandler
-
skippedEntity
Is ignored by this implementation.- Specified by:
skippedEntity
in interfaceContentHandler
-
setDocumentLocator
Is ignored by this implementation.- Specified by:
setDocumentLocator
in interfaceContentHandler
-
startPrefixMapping
Is ignored by this implementation. All sax events are assumed to contain complete and consistent namespace information (URI, localname, qname).- Specified by:
startPrefixMapping
in interfaceContentHandler
-