|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.xml.Document
A wrapper class that implements some functionality of
org.jdom.Document
using org.w3c.dom.Document
.
Field Summary | |
protected org.w3c.dom.Document |
m_document
The internal DOM document being wrapped. |
protected static javax.xml.parsers.DocumentBuilderFactory |
s_builder
A single DocumentBuilderFactory to use for
creating Documents. |
protected static ThreadLocal |
s_db
A single DocumentBuilder to use for
creating Documents. |
static String |
versionId
|
Constructor Summary | |
Document()
Creates a new Document class with no root element. |
|
Document(byte[] xmlBytes)
|
|
Document(org.w3c.dom.Document doc)
Creates a new Document class based on an org.w3c.dom.Document. |
|
Document(Element rootNode)
Creates a new Document class with the given root element. |
|
Document(String xmlString)
Creates a document from the passed in string that should be properly formatted XML |
Method Summary | |
Element |
createRootElement(String elt)
Creates a new element and sets it as the root. |
Element |
createRootElement(String elt,
String ns)
Creates a new element and sets it as the root. |
org.w3c.dom.Document |
getInternalDocument()
Not a part of org.jdom.Document , this function returns
the internal DOM representation of this document. |
Element |
getRootElement()
Returns the root element for the document. |
Document |
setRootElement(Element rootNode)
Sets the root element. |
String |
toString()
Generates an XML text representation of this document, without additional indenting. |
String |
toString(boolean indent)
Generates an XML text representation of this document. |
static String |
toString(org.w3c.dom.Document document)
Convenience wrapper for static toString(Document, boolean), without additional indenting. |
static String |
toString(org.w3c.dom.Document document,
boolean indent)
General toString() method for org.w3c.domDocument. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
protected static javax.xml.parsers.DocumentBuilderFactory s_builder
DocumentBuilderFactory
to use for
creating Documents.
protected static ThreadLocal s_db
DocumentBuilder
to use for
creating Documents.
protected org.w3c.dom.Document m_document
Constructor Detail |
public Document() throws javax.xml.parsers.ParserConfigurationException
public Document(org.w3c.dom.Document doc)
doc
- the org.w3c.dom.Documentpublic Document(Element rootNode) throws javax.xml.parsers.ParserConfigurationException
rootNode
- the element to use as the root nodepublic Document(String xmlString) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
public Document(byte[] xmlBytes) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
Method Detail |
public Document setRootElement(Element rootNode)
rootNode
- the element to use as the root node
public Element createRootElement(String elt, String ns)
Element root = new Element("name", NS); doc.setRootElement(root);
elt
- the element namens
- the element's namespace URI
public Element createRootElement(String elt)
Element root = new Element("name", NS); doc.setRootElement(root);
elt
- the element name
public Element getRootElement()
public org.w3c.dom.Document getInternalDocument()
org.jdom.Document
, this function returns
the internal DOM representation of this document. This method should
only be used when passing the DOM to the translator. It will require
changes once JDOM replaces this class.
public static String toString(org.w3c.dom.Document document, boolean indent)
document
- the org.w3c.dom.Document
object
to convert to a String representationindent
- if true
, try to indent elements according to normal
XML/SGML indentation conventions (may only work with certain
XSLT engines)
document
.public static String toString(org.w3c.dom.Document document)
document
- the org.w3c.dom.Document
to output
document
.public String toString(boolean indent)
indent
- if true
, try to indent XML elements according
to XML/SGML convention
this
.public String toString()
this
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |