|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcdx.scorebot.util.io.XStreamWrapper
public final class XStreamWrapper
This class instantiates an XStream and aliases all known USNA ScoreBot classes so they have a reasonable tag in the XML files.
Field Summary | |
---|---|
static com.thoughtworks.xstream.XStream |
xml
XStream object used to read/write xml |
Method Summary | |
---|---|
static java.lang.Object |
fromXML(java.io.File file)
reads (deserializes) an object from an XML file |
static java.lang.Object |
fromXML(java.lang.String fn)
reads (deserializes) an object from an XML file |
static void |
toXML(java.io.File file,
java.lang.Object o)
writes (serializes) an object in XML form to a file |
static java.lang.String |
toXML(java.lang.Object o)
writes (serializes) an object in XML form to a string |
static void |
toXML(java.lang.String fn,
java.lang.Object o)
writes (serializes) an object in XML form to a file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final com.thoughtworks.xstream.XStream xml
Method Detail |
---|
public static java.lang.Object fromXML(java.lang.String fn) throws com.thoughtworks.xstream.core.BaseException, java.io.FileNotFoundException
fn
- the filename to read the XML from
com.thoughtworks.xstream.core.BaseException
- if the object cannot be deserialized
java.io.FileNotFoundException
- if the file exists but is a directory rather
than a regular file, does not exist but cannot
be created, or cannot be opened for any other reasonpublic static java.lang.Object fromXML(java.io.File file) throws com.thoughtworks.xstream.core.BaseException, java.io.FileNotFoundException
file
- the file to read the XML from
com.thoughtworks.xstream.core.BaseException
- if the object cannot be deserialized
java.io.FileNotFoundException
- if the file exists but is a directory rather
than a regular file, does not exist but cannot
be created, or cannot be opened for any other reasonpublic static void toXML(java.lang.String fn, java.lang.Object o) throws com.thoughtworks.xstream.core.BaseException, java.io.FileNotFoundException
fn
- the filename to write the XML too
- the object to create the XML for
com.thoughtworks.xstream.core.BaseException
- if the object cannot be deserialized
java.io.FileNotFoundException
- if the file exists but is a directory rather
than a regular file, does not exist but cannot
be created, or cannot be opened for any other reasonpublic static void toXML(java.io.File file, java.lang.Object o) throws com.thoughtworks.xstream.core.BaseException, java.io.FileNotFoundException
file
- the object to create the XML foro
- the object to create the XML for
com.thoughtworks.xstream.core.BaseException
- if the object cannot be deserialized
java.io.FileNotFoundException
- if the file exists but is a directory rather
than a regular file, does not exist but cannot
be created, or cannot be opened for any other reasonpublic static java.lang.String toXML(java.lang.Object o) throws com.thoughtworks.xstream.core.BaseException
o
- the object to create the XML for
com.thoughtworks.xstream.core.BaseException
- if the object cannot be deserialized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |