Class XmlMessageSerde
java.lang.Object
energy.eddie.outbound.shared.serde.XmlMessageSerde
- All Implemented Interfaces:
MessageSerde
A
MessageSerde implementation that produces CIM compliant XML.
Can also serialize and deserialize unknown types to and from XML.
Uses the JAXB for CIM documents and ObjectMapper as fallback.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tdeserialize(byte[] message, Class<T> messageType) Deserializes a message to a given class.byte[]Serializes an object to a byte array.
-
Constructor Details
-
XmlMessageSerde
- Throws:
SerdeInitializationException
-
-
Method Details
-
serialize
Description copied from interface:MessageSerdeSerializes an object to a byte array.- Specified by:
serializein interfaceMessageSerde- Parameters:
message- the object to be serialized.- Returns:
- a serialized byte array
- Throws:
SerializationException- if the serialization failed
-
deserialize
Description copied from interface:MessageSerdeDeserializes a message to a given class.- Specified by:
deserializein interfaceMessageSerde- Type Parameters:
T- the destination type.- Parameters:
message- the message that should be deserialized.messageType- the class of the destination type.- Returns:
- the deserialized object.
- Throws:
DeserializationException- if the deserialization fails.
-