|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.simpleframework.xml.core.Persister
org.android.activityminer.model.util.GlobalSerializer
public final class GlobalSerializer
The global serializer does hold a singleton Persister instance of the Simple XML framework. It does provide static methods for serialization and deserialization purpose and supports the new annotation strategy.
| Field Summary | |
|---|---|
private static org.simpleframework.xml.core.Persister |
serializer
The global serializer instance |
| Constructor Summary | |
|---|---|
GlobalSerializer()
|
|
| Method Summary | ||
|---|---|---|
static
|
fromXML(Class<T> c,
String xml)
Deserialization from the XML representation to the type |
|
static
|
serializeFromFile(Class<T> c,
File file)
Deserialization from the XML file to the type |
|
static
|
serializeFromStream(Class<T> c,
InputStream is)
Deserialization from an input stream to the type |
|
static void |
serializeToFile(Object source,
File file)
Method to serialize an object into a file |
|
static void |
serializeToStream(Object source,
OutputStream os)
Method to serialize an object into an output stream |
|
static String |
toXml(Object source)
Method to serialize an object |
|
| Methods inherited from class org.simpleframework.xml.core.Persister |
|---|
read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, validate, validate, validate, validate, validate, validate, validate, validate, validate, validate, write, write, write, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.simpleframework.xml.core.Persister serializer
| Constructor Detail |
|---|
public GlobalSerializer()
| Method Detail |
|---|
public static String toXml(Object source)
throws Exception
source - the source object to serialize
Exception - if the schema for the object is not valid
public static void serializeToFile(Object source,
File file)
throws Exception
source - the source object to serializefile - the file to write serialized object into
Exception - if the schema for the object is not valid
public static void serializeToStream(Object source,
OutputStream os)
throws Exception
source - the source object to serializeos - the output stream to write serialized object into
Exception - if the schema for the object is not valid
public static <T> T serializeFromFile(Class<T> c,
File file)
throws Exception
T - the type to deserializec - the class of the type to deserializefile - the XML file
Exception - if the object cannot be fully deserialized
public static <T> T serializeFromStream(Class<T> c,
InputStream is)
throws Exception
T - the type to deserializec - the class of the type to deserializeis - the input stream
Exception - if the object cannot be fully deserialized
public static <T> T fromXML(Class<T> c,
String xml)
throws Exception
T - the type to deserializec - the class of the type to deserializexml - the XML representation of the type as string
Exception - if the object cannot be fully deserialized
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||