|
||||||||||
| 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 String |
FILE_EXTENSION
the extension for XStream files (including '.') |
| Constructor Summary | |
|---|---|
XStream()
|
|
| Method Summary | |
|---|---|
static Object |
deSerialize(String xmlString)
Deserializes an object from the supplied XML string |
String |
getRevision()
Returns the revision string. |
static boolean |
isPresent()
returns whether XStream is present or not, i.e. |
static Object |
read(File file)
reads the XML-serialized object from the given file |
static Object |
read(InputStream stream)
reads the XML-serialized object from the given input stream |
static Object |
read(Reader r)
reads the XML-serialized object from the given Reader |
static Object |
read(String filename)
reads the XML-serialized object from the given file |
static String |
serialize(Object toSerialize)
Serializes the supplied object xml |
static boolean |
write(File file,
Object o)
write the XML-serialized object to the given file |
static boolean |
write(OutputStream stream,
Object o)
writes the XML-serialized object to the given output stream |
static boolean |
write(String filename,
Object o)
writes the XML-serialized object to the given file |
static boolean |
write(Writer writer,
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 String FILE_EXTENSION
| Constructor Detail |
|---|
public XStream()
| Method Detail |
|---|
public static boolean isPresent()
public static String serialize(Object toSerialize)
throws Exception
toSerialize - the object to serialize
Exception - if something goes wrong
public static boolean write(String filename,
Object o)
throws Exception
filename - the file to serialize the object too - the object to write to the file
Exception - if something goes wrong while writing to the file
public static boolean write(File file,
Object o)
throws Exception
file - the file to serialize the object too - the object to write to the file
Exception - if something goes wrong while writing to the file
public static boolean write(OutputStream stream,
Object o)
throws Exception
stream - the output streamo - the object to write
Exception
public static boolean write(Writer writer,
Object toSerialize)
throws Exception
writer - the WritertoSerialize - the object to write
Exception - if something goes wrong
public static Object read(String filename)
throws Exception
filename - the file to deserialize the object from
Exception - if something goes wrong while reading from the file
public static Object read(File file)
throws Exception
file - the file to deserialize the object from
Exception - if something goes wrong while reading from the file
public static Object read(InputStream stream)
throws Exception
stream - the input stream
Exception - if something goes wrong while reading from stream
public static Object read(Reader r)
throws Exception
r - the reader
Exception - if something goes wrong while reading from stream
public static Object deSerialize(String xmlString)
throws Exception
xmlString - the XML to deserialize from
Exception - if something goes wrongpublic String getRevision()
getRevision in interface RevisionHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||