com.genesyslab.platform.commons.protocol
Class XmlMessageSerializer
java.lang.Object
com.genesyslab.platform.commons.protocol.XmlMessageSerializer
- public class XmlMessageSerializer
- extends java.lang.Object
Method Summary |
Message |
deserialize(javax.xml.transform.Source doc)
Deserialize (restore) the message from an xml document |
void |
serialize(Message message,
javax.xml.transform.Result result)
Serialize protocol message to XML document. |
void |
setTransformer(javax.xml.transform.Transformer transformer)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlMessageSerializer
public XmlMessageSerializer(ProtocolFactory factory)
- Create 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
- Serialize 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
- Deserialize (restore) 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 topic.
Copyright © 2006–2008 Genesys Telecommunication Laboratories, Inc. All rights reserved.