Package com.thoughtworks.xstream.io.xml
Class Dom4JXmlWriter
- java.lang.Object
-
- com.thoughtworks.xstream.io.AbstractWriter
-
- com.thoughtworks.xstream.io.xml.AbstractXmlWriter
-
- com.thoughtworks.xstream.io.xml.Dom4JXmlWriter
-
- All Implemented Interfaces:
ExtendedHierarchicalStreamWriter
,HierarchicalStreamWriter
,XmlFriendlyWriter
public class Dom4JXmlWriter extends AbstractXmlWriter
-
-
Field Summary
Fields Modifier and Type Field Description private org.xml.sax.helpers.AttributesImpl
attributes
private boolean
children
private FastStack
elementStack
private boolean
started
private org.dom4j.io.XMLWriter
writer
-
Constructor Summary
Constructors Constructor Description Dom4JXmlWriter(org.dom4j.io.XMLWriter writer)
Dom4JXmlWriter(org.dom4j.io.XMLWriter writer, NameCoder nameCoder)
Dom4JXmlWriter(org.dom4j.io.XMLWriter writer, XmlFriendlyReplacer replacer)
Deprecated.As of 1.4 useDom4JXmlWriter(XMLWriter, NameCoder)
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(java.lang.String key, java.lang.String value)
void
close()
Close the writer, if necessary.void
endNode()
void
flush()
Flush the writer, if necessary.void
setValue(java.lang.String text)
Write the value (text content) of the current node.private void
startElement()
void
startNode(java.lang.String name)
-
Methods inherited from class com.thoughtworks.xstream.io.xml.AbstractXmlWriter
escapeXmlName
-
Methods inherited from class com.thoughtworks.xstream.io.AbstractWriter
encodeAttribute, encodeNode, startNode, underlyingWriter
-
-
-
-
Field Detail
-
writer
private final org.dom4j.io.XMLWriter writer
-
elementStack
private final FastStack elementStack
-
attributes
private org.xml.sax.helpers.AttributesImpl attributes
-
started
private boolean started
-
children
private boolean children
-
-
Constructor Detail
-
Dom4JXmlWriter
public Dom4JXmlWriter(org.dom4j.io.XMLWriter writer)
-
Dom4JXmlWriter
public Dom4JXmlWriter(org.dom4j.io.XMLWriter writer, NameCoder nameCoder)
- Since:
- 1.4
-
Dom4JXmlWriter
public Dom4JXmlWriter(org.dom4j.io.XMLWriter writer, XmlFriendlyReplacer replacer)
Deprecated.As of 1.4 useDom4JXmlWriter(XMLWriter, NameCoder)
instead.- Since:
- 1.2
-
-
Method Detail
-
startNode
public void startNode(java.lang.String name)
-
setValue
public void setValue(java.lang.String text)
Description copied from interface:HierarchicalStreamWriter
Write the value (text content) of the current node.
-
addAttribute
public void addAttribute(java.lang.String key, java.lang.String value)
-
endNode
public void endNode()
-
flush
public void flush()
Description copied from interface:HierarchicalStreamWriter
Flush the writer, if necessary.
-
close
public void close()
Description copied from interface:HierarchicalStreamWriter
Close the writer, if necessary.
-
startElement
private void startElement() throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
-