class XmlRemapperIO
extends java.lang.Object
RamRemapper
and derived classes from/to backing XML file.Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ATTR_NODE_CLASS
XML attribute name for the node object class name
|
private static java.lang.String |
ATTR_NODE_NAME
XML attribute name for the node name
|
private static java.lang.String |
ATTR_NODEATTR_NAME
XML attribute name for the node attribute name
|
private static java.lang.String |
ATTR_NODEATTR_VALUE
XML attribute name for the node attribute value
|
private org.w3c.dom.Document |
dom
XML document
|
private static java.lang.String |
ELEM_TAG_NODE
XML tag for the node element
|
private static java.lang.String |
ELEM_TAG_NODEATTR
XML tag for the node attribute element
|
private static java.lang.String |
ELEM_TAG_ROOT
XML tag for the root element
|
private XmlProcessor |
processor
XML document processor
|
private RamRemapper |
remapper
An instance of the
RamRemapper used to retrieve object
classes. |
Constructor and Description |
---|
XmlRemapperIO(RamRemapper remapper,
XmlProcessor processor)
Construct an instance of the
XmlRemapperIO . |
Modifier and Type | Method and Description |
---|---|
(package private) void |
load(java.io.InputStream in)
Load tree from the XML document.
|
private RamNode |
readNode(org.w3c.dom.Node node)
Read one node from the XML document.
|
(package private) void |
save(java.io.OutputStream out)
Store tree into stream in XML file.
|
private void |
writeNode(RamNode ramNode,
org.w3c.dom.Node parent)
Create and write one node into document.
|
private static java.lang.String ATTR_NODE_CLASS
private static java.lang.String ATTR_NODE_NAME
private static java.lang.String ATTR_NODEATTR_NAME
private static java.lang.String ATTR_NODEATTR_VALUE
private static java.lang.String ELEM_TAG_NODE
private static java.lang.String ELEM_TAG_NODEATTR
private static java.lang.String ELEM_TAG_ROOT
private org.w3c.dom.Document dom
private RamRemapper remapper
RamRemapper
used to retrieve object
classes.private final XmlProcessor processor
XmlRemapperIO(RamRemapper remapper, XmlProcessor processor)
XmlRemapperIO
.remapper
- An instance of the RamRemapper
which will be
later saved or restored.processor
- Optional XML processing class.void load(java.io.InputStream in) throws java.lang.Exception
in
- InputStream
from which XML document will be
read.java.lang.Exception
- Various exceptions are forwarded from XmlHelper
or thrown in case of errors.void save(java.io.OutputStream out) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException
out
- OutputStream which will be used to store XML.javax.xml.parsers.ParserConfigurationException
- Forwarded from XmlHelper.java.io.IOException
- Forwarded from XmlHelper.private RamNode readNode(org.w3c.dom.Node node)
node
- Node instance to read data from.RamNode
or null
if
something went wrong.private void writeNode(RamNode ramNode, org.w3c.dom.Node parent)
ramNode
- Directory tree node information about which should be written.parent
- Parent Document node which will hold information about new
node.