public abstract class XMLWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
encoding |
protected java.util.logging.Logger |
maintLogger |
protected boolean |
standalone |
protected java.util.logging.Logger |
supportLogger |
protected java.util.logging.Logger |
userLogger |
protected java.lang.String |
version |
protected java.lang.String |
xml |
Constructor and Description |
---|
XMLWriter() |
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Element |
appendChild(org.w3c.dom.Element parent,
java.lang.String name)
Append a new child element to the specified element.
|
org.w3c.dom.Element |
appendChild(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.String uri)
Append a new child element to the specified element.
|
org.w3c.dom.Element |
appendChild(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.String[] attrNames,
java.lang.String[] attrValues)
Append a DOM Element with the given name and attributes to the specified parent Element.
|
org.w3c.dom.Element |
appendChild(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.String attrName,
java.lang.String attrValue)
Append a DOM Element with the given name and attribute to the specified parent Element.
|
org.w3c.dom.Element |
appendChild(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.String value,
java.lang.String attrName,
java.lang.String attrValue)
Append a DOM Element with the given name, text content value and attribute to the specified parent Element.
|
org.w3c.dom.Element |
appendChild(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.String uri,
java.lang.String value,
java.lang.String[] attrNames,
java.lang.String[] attrValues)
Append a DOM Element with the given name and attributes to the specified parent Element.
|
void |
appendChildren(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.String[] values)
Append multiple DOM Elements to the given Element, each having a specified text content.
|
protected abstract org.w3c.dom.Element |
createElement(java.lang.String uri,
java.lang.String name) |
abstract org.w3c.dom.Element |
getRoot()
Get the root element of the DOM tree associated with this writer.
|
protected abstract XMLBuilder |
getXMLBuilder() |
protected abstract boolean |
isParserValidating() |
static XMLWriter |
newInstance()
Get an instance of the default implementation of XMLWriter.
|
protected abstract javax.xml.parsers.SAXParser |
newSAXParser() |
protected abstract void |
setRoot(org.w3c.dom.Element newRoot)
Set the root element of the DOM tree associated with this writer.
|
java.lang.String |
toXML(XmlOutputConfig xmlOutputConfig)
Serialize to XML format the DOM tree currently associated with this XMLWriter.
|
protected java.lang.String xml
protected java.lang.String version
protected java.lang.String encoding
protected boolean standalone
protected java.util.logging.Logger supportLogger
protected java.util.logging.Logger userLogger
protected java.util.logging.Logger maintLogger
public static XMLWriter newInstance()
public abstract org.w3c.dom.Element getRoot()
protected abstract javax.xml.parsers.SAXParser newSAXParser() throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
protected abstract boolean isParserValidating()
protected abstract XMLBuilder getXMLBuilder()
protected abstract void setRoot(org.w3c.dom.Element newRoot)
newRoot
- The DOM Element to assign as the root.protected abstract org.w3c.dom.Element createElement(java.lang.String uri, java.lang.String name)
public org.w3c.dom.Element appendChild(org.w3c.dom.Element parent, java.lang.String name)
parent
- The element which will be the parent element of the new element.name
- The name of the new element (tag).public org.w3c.dom.Element appendChild(org.w3c.dom.Element parent, java.lang.String name, java.lang.String uri)
parent
- The element which will be the parent element of the new element.name
- The name of the new element (tag).uri
- Namespace URI for the new child element.public org.w3c.dom.Element appendChild(org.w3c.dom.Element parent, java.lang.String name, java.lang.String attrName, java.lang.String attrValue)
Element
will be in the namespace of its parent.parent
- The parent of the new Element.name
- The name of the new Element.attrName
- The name of the attribute of the new Element.attrValue
- The value of the attribute named attrName
.public org.w3c.dom.Element appendChild(org.w3c.dom.Element parent, java.lang.String name, java.lang.String value, java.lang.String attrName, java.lang.String attrValue)
Element
will be in the namespace of its parent.parent
- The parent of the new Element.name
- The name of the new Element.value
- The text content to assign to the text node child of the new Element.attrName
- The name of the attribute of the new Element.attrValue
- The value of the attribute named attrName
.public org.w3c.dom.Element appendChild(org.w3c.dom.Element parent, java.lang.String name, java.lang.String[] attrNames, java.lang.String[] attrValues)
attrNames
and attrValues
must have the same length and be ordered such that the nth element of
attrValues
corresponds to the attribute with the name given by the nth element of attrNames
. The
new Element
will be in the namespace of its parent.parent
- The parent of the new Element.name
- The name of the new Element.attrNames
- The names of the attributes of the new Element.attrValues
- The values of each of the attributes attrName
.public org.w3c.dom.Element appendChild(org.w3c.dom.Element parent, java.lang.String name, java.lang.String uri, java.lang.String value, java.lang.String[] attrNames, java.lang.String[] attrValues)
attrNames
and attrValues
must have the
same length and be ordered such that the nth element of attrValues
corresponds to the attribute with the
name given by the nth element of attrNames
.parent
- The parent of the new Element.name
- The name of the new Element.uri
- The URI of the new Element's namespace.attrNames
- The names of the attributes of the new Element.attrValues
- The values of each of the attributes attrName
.public void appendChildren(org.w3c.dom.Element parent, java.lang.String name, java.lang.String[] values)
values
array. The new Element
will be in the namespace
of its parent.parent
- The parent of the new Elements.name
- The name of the new Elements.public java.lang.String toXML(XmlOutputConfig xmlOutputConfig) throws org.xml.sax.SAXException
org.xml.sax.SAXException
- the SAX exception
HandlerFactory
. That handler will receive notification of
parsing/validation failures.