|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.architecture.traffic.xml.XMLSaver
public class XMLSaver
This class takes care of saving the state of the program to a XML file. It also provides methods which XMLSerializable objects can use to save their child objects.
| Field Summary | |
|---|---|
protected XMLStack |
stack
DOCUMENT ME! |
protected org.jscience.architecture.traffic.xml.XMLWriter |
writer
DOCUMENT ME! |
| Constructor Summary | |
|---|---|
protected |
XMLSaver()
Make a new XMLSaver |
|
XMLSaver(java.io.File file)
Makes a new XMLSaver which saves to a file |
|
XMLSaver(java.lang.String hostname,
int port)
Makes a new XMLSaver which saves to a socket |
| Method Summary | |
|---|---|
void |
close()
Close this XMLSaver |
boolean |
hasStream()
A crude indication if we can write to this XMLSaver |
protected int |
indent()
DOCUMENT ME! |
void |
saveAtomaryElement(XMLSerializable parent,
XMLElement el)
Save an atomary XML element |
void |
saveEnumerationObjects(java.util.Enumeration e)
Save an enumeration of XML Serializables to file |
void |
saveObject(XMLSerializable object)
Save a XMLSerializable object to the XML file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.jscience.architecture.traffic.xml.XMLWriter writer
protected XMLStack stack
| Constructor Detail |
|---|
protected XMLSaver()
public XMLSaver(java.io.File file)
throws java.io.IOException
file - The file to save to
java.io.IOException - If the XMLSaver cannot open the XML file because of
an IO error.
public XMLSaver(java.lang.String hostname,
int port)
throws java.io.IOException
hostname - The hostname to connect toport - The port to connect to
java.io.IOException - If the XMLSaver cannot open the socket connection
because of an IO error.| Method Detail |
|---|
public boolean hasStream()
public void close()
public void saveObject(XMLSerializable object)
throws java.io.IOException,
XMLTreeException,
XMLCannotSaveException
object - The object to save
java.io.IOException - If the XMLSaver cannot write to the XML file because
of an IO error.
XMLTreeException - If something goes wrong while the parser is
building the XML tree structure for this object
XMLCannotSaveException - If this object cannot save itself
public void saveEnumerationObjects(java.util.Enumeration e)
throws java.lang.ClassCastException,
XMLTreeException,
java.io.IOException,
XMLCannotSaveException
e - The enumeration of XML Serializables
java.lang.ClassCastException - If the enumeration contains an object that is
not XMLSerializable
XMLTreeException - If something goes wrong while the parser is
building the XML tree structure for one of the objects.
java.io.IOException - If the XMLSaver cannot write to the XML file because
of an IO error.
XMLCannotSaveException - If one of the objects cannot save itself
for one reason or another.
public void saveAtomaryElement(XMLSerializable parent,
XMLElement el)
throws java.io.IOException,
XMLTreeException
parent - DOCUMENT ME!el - The XMLElement to save
java.io.IOException - If the XMLSaver cannot write to the XML file because
of an IO error.
XMLTreeException - If there is a parser problem with writing the
element.protected int indent()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||