|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.xml.XStream
public class XStream
This class is a helper class for XML serialization using XStream . XStream does not need to be present, since the class-calls are done generically via Reflection.
Field Summary | |
---|---|
static java.lang.String |
FILE_EXTENSION
the extension for XStream files (including '.') |
Constructor Summary | |
---|---|
XStream()
|
Method Summary | |
---|---|
static java.lang.Object |
deSerialize(java.lang.String xmlString)
Deserializes an object from the supplied XML string |
java.lang.String |
getRevision()
Returns the revision string. |
static boolean |
isPresent()
returns whether XStream is present or not, i.e. |
static java.lang.Object |
read(java.io.File file)
reads the XML-serialized object from the given file |
static java.lang.Object |
read(java.io.InputStream stream)
reads the XML-serialized object from the given input stream |
static java.lang.Object |
read(java.io.Reader r)
reads the XML-serialized object from the given Reader |
static java.lang.Object |
read(java.lang.String filename)
reads the XML-serialized object from the given file |
static java.lang.String |
serialize(java.lang.Object toSerialize)
Serializes the supplied object xml |
static boolean |
write(java.io.File file,
java.lang.Object o)
write the XML-serialized object to the given file |
static boolean |
write(java.io.OutputStream stream,
java.lang.Object o)
writes the XML-serialized object to the given output stream |
static boolean |
write(java.lang.String filename,
java.lang.Object o)
writes the XML-serialized object to the given file |
static boolean |
write(java.io.Writer writer,
java.lang.Object toSerialize)
writes the XML-serialized object to the given Writer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_EXTENSION
Constructor Detail |
---|
public XStream()
Method Detail |
---|
public static boolean isPresent()
public static java.lang.String serialize(java.lang.Object toSerialize) throws java.lang.Exception
toSerialize
- the object to serialize
java.lang.Exception
- if something goes wrongpublic static boolean write(java.lang.String filename, java.lang.Object o) throws java.lang.Exception
filename
- the file to serialize the object too
- the object to write to the file
java.lang.Exception
- if something goes wrong while writing to the filepublic static boolean write(java.io.File file, java.lang.Object o) throws java.lang.Exception
file
- the file to serialize the object too
- the object to write to the file
java.lang.Exception
- if something goes wrong while writing to the filepublic static boolean write(java.io.OutputStream stream, java.lang.Object o) throws java.lang.Exception
stream
- the output streamo
- the object to write
java.lang.Exception
public static boolean write(java.io.Writer writer, java.lang.Object toSerialize) throws java.lang.Exception
writer
- the Writero
- the object to write
java.lang.Exception
public static java.lang.Object read(java.lang.String filename) throws java.lang.Exception
filename
- the file to deserialize the object from
java.lang.Exception
- if something goes wrong while reading from the filepublic static java.lang.Object read(java.io.File file) throws java.lang.Exception
file
- the file to deserialize the object from
java.lang.Exception
- if something goes wrong while reading from the filepublic static java.lang.Object read(java.io.InputStream stream) throws java.lang.Exception
stream
- the input stream
java.lang.Exception
- if something goes wrong while reading from streampublic static java.lang.Object read(java.io.Reader r) throws java.lang.Exception
r
- the reader
java.lang.Exception
- if something goes wrong while reading from streampublic static java.lang.Object deSerialize(java.lang.String xmlString) throws java.lang.Exception
xmlString
- the XML to deserialize from
java.lang.Exception
- if something goes wrongpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |