com.genesyslab.platform.commons.protocol
Class XmlMessageSerializer
java.lang.Object
com.genesyslab.platform.commons.protocol.XmlMessageSerializer
- Direct Known Subclasses:
- RoutingServerXmlMessageSerializer, UniversalContactServerXmlMessageSerializer
public class XmlMessageSerializer
- extends java.lang.Object
Method Summary |
Message |
deserialize(javax.xml.transform.Source doc)
Deserializes (restores) the message from an xml document. |
void |
serialize(Message message,
javax.xml.transform.Result result)
Serializes protocol message to XML document. |
void |
setTransformer(javax.xml.transform.Transformer transformer)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlMessageSerializer
public XmlMessageSerializer(ProtocolFactory factory)
- Creates serializer for the protocol described by its factory.
- Parameters:
factory
- protocol factory
serialize
public void serialize(Message message,
javax.xml.transform.Result result)
throws javax.xml.parsers.ParserConfigurationException,
com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
- Serializes protocol message to XML document.
There is following behavior if you work with DOM documents as result:
- if some node is given as result then the element created from message is appended
to it
- if some document is given as result then the message element will be root of the
document and may replace old root if there was one
- if result is empty then the new document will be created with message element
at its root
- Parameters:
message
- Message to serializeresult
- xml representation of the message
- Throws:
javax.xml.parsers.ParserConfigurationException
- if failed to create document
com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
- if some custom type object can't be serialized
deserialize
public Message deserialize(javax.xml.transform.Source doc)
throws com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
- Deserializes (restores) the message from an xml document.
- Parameters:
doc
- xml representation of the message
- Returns:
- deserialized message
- Throws:
com.genesyslab.platform.commons.protocol.runtime.codec.CodecException
- if some custom type object can't be deserialized
setTransformer
public void setTransformer(javax.xml.transform.Transformer transformer)
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.