eneter.messaging.dataprocessing.serializing
Class XmlStringSerializer
java.lang.Object
eneter.messaging.dataprocessing.serializing.XmlStringSerializer
- All Implemented Interfaces:
- ISerializer
public class XmlStringSerializer
- extends java.lang.Object
- implements ISerializer
Serializes data to XML which is compatible with .NET.
This is the default serializer used by the framework. The serializer is compatible
with XmlStringSerializer from Eneter Messaging Framework for .NET.
Therefore, you can use it for the communication between Java and .NET applications.
The serializer does not support generic types on Java and Android platforms!
Method Summary |
|
deserialize(java.lang.Object serializedData,
java.lang.Class<T> clazz)
Deserializes data into the specified type. |
|
serialize(T dataToSerialize,
java.lang.Class<T> clazz)
Serializes data to the xml string. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlStringSerializer
public XmlStringSerializer()
serialize
public <T> java.lang.Object serialize(T dataToSerialize,
java.lang.Class<T> clazz)
throws java.lang.Exception
- Serializes data to the xml string.
- Specified by:
serialize
in interface ISerializer
- Parameters:
dataToSerialize
- Data to be serialized.clazz
- represents the serialized type.
- Returns:
- Object representing the serialized data.
Based on the serializer implementation it can be byte[] or String.
- Throws:
java.lang.Exception
- If the serialization fails.
deserialize
public <T> T deserialize(java.lang.Object serializedData,
java.lang.Class<T> clazz)
throws java.lang.Exception
- Deserializes data into the specified type.
- Specified by:
deserialize
in interface ISerializer
- Parameters:
serializedData
- Data to be deserialized.
- Returns:
- Deserialized object.
- Throws:
java.lang.Exception
- If the deserialization fails.