Package eu.bandm.tools.util
Class SAX2DOMConverter
java.lang.Object
eu.bandm.tools.util.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
ATTENTION, document node and top-level element are already built!
(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
ATTENTION, document node and top-level element are already built!
(4) finally call
sdc.getDocument() -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] data, int start, int length) evidentvoidIs ignored by this implementation.voidendElement(String namespaceURI, String localName, String qName) evidentvoidendPrefixMapping(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 explicityl by a call tosetDOMImplementation(org.w3c.dom.DOMImplementation).voidignorableWhitespace(char[] data, int start, int length) Is ignored by this implementation.voidprocessingInstruction(String target, String text) Is ignored by this implementation.voidsetDocumentLocator(Locator locator) Is ignored by this implementation.voidsetDocumentURI(String documentUri) Set the document URI.voidsetDOMImplementation(DOMImplementation domImpl) Sets the system-dependent factory which will deliver the dom object.voidskippedEntity(String name) Is ignored by this implementation.voidCreates a new document.voidstartElement(String namespaceURI, String localName, String qName, Attributes attrs) evidentvoidstartPrefixMapping(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, waitMethods 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 explicityl 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:
startDocumentin interfaceContentHandler
-
setDocumentURI
Set the document URI. The value goes directly toDocumentand 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:
startElementin interfaceContentHandler
-
endElement
evident- Specified by:
endElementin interfaceContentHandler
-
characters
public void characters(char[] data, int start, int length) evident- Specified by:
charactersin interfaceContentHandler
-
endDocument
public void endDocument()Is ignored by this implementation.- Specified by:
endDocumentin interfaceContentHandler
-
endPrefixMapping
Is ignored by this implementation. All sax events are assumed to contain complete and consistent namespace information (URI, localname, qname).- Specified by:
endPrefixMappingin interfaceContentHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] data, int start, int length) Is ignored by this implementation.- Specified by:
ignorableWhitespacein interfaceContentHandler
-
processingInstruction
Is ignored by this implementation.- Specified by:
processingInstructionin interfaceContentHandler
-
skippedEntity
Is ignored by this implementation.- Specified by:
skippedEntityin interfaceContentHandler
-
setDocumentLocator
Is ignored by this implementation.- Specified by:
setDocumentLocatorin interfaceContentHandler
-
startPrefixMapping
Is ignored by this implementation. All sax events are assumed to contain complete and consistent namespace information (URI, localname, qname).- Specified by:
startPrefixMappingin interfaceContentHandler
-