com.bea.alsb.financial.api
Class MessageWrapper<T>

java.lang.Object
  extended by com.bea.alsb.financial.api.MessageWrapper<T>
Type Parameters:
T - the type of message data object being wrapped.

public class MessageWrapper<T>
extends Object

This class encapsulates a parsed message along with other information: - errors that resulted from the last operation, - message name as defined in the designer - message context to define special properties when processing the message, currently not used


Nested Class Summary
static class MessageWrapper.NullMessageDataObjectException
          This exception is thrown by the API operations when the message data object is null.
 
Constructor Summary
MessageWrapper()
           
 
Method Summary
 XmlErrors getErrors()
          Getter for the errors reported by the last operation on this message wrapper.
 MessageContext getMessageContext()
          Getter for the messageContext property.
 T getMessageDataObject()
          Getter for the message data object - the actual message being wrapped.
 String getMessageName()
          Getter for the message name as defined in the Financial Message Designer.
 void setMessageContext(MessageContext messageContext)
          Setter for the message context in this wrapper.
 void setMessageDataObject(T messageDataObject)
          Setter for the message data object.
 void setMessageName(String messageType)
          Setter for the message name as defined in the Financial Message Designer.
 void setXmlErrors(XmlErrors errors)
          Set the errors XML for this wrapper.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageWrapper

public MessageWrapper()
Method Detail

getMessageContext

public MessageContext getMessageContext()
Getter for the messageContext property.

Returns:
the message context in this wrapper.

setMessageContext

public void setMessageContext(MessageContext messageContext)
Setter for the message context in this wrapper.

Parameters:
messageContext - the new message context in this wrapper.

getMessageName

public String getMessageName()
Getter for the message name as defined in the Financial Message Designer. Note this is case-sensitive.

Returns:
the message name

setMessageName

public void setMessageName(String messageType)
Setter for the message name as defined in the Financial Message Designer.

Parameters:
messageType - the case-sensitive message name.

getMessageDataObject

public T getMessageDataObject()
Getter for the message data object - the actual message being wrapped.

Returns:
the wrapped message data object.

setMessageDataObject

public void setMessageDataObject(T messageDataObject)
Setter for the message data object.

Parameters:
messageDataObject - the new message data object this wrapper will represent.

getErrors

public XmlErrors getErrors()
Getter for the errors reported by the last operation on this message wrapper. The operation must have been executed with throwOnError set to false for anything to be captured in here. Examples of operations storing errors in here are ParseAPI.parseText(String, String, boolean), ParseAPI.parseXML(org.apache.xmlbeans.XmlObject, String, boolean), ValidationAPI.validate(MessageWrapper, boolean), SerializationAPI.serializeToText(MessageWrapper, boolean). For more details about the xml structure refers to the schemas provided with the facade Jar file.

Returns:
the errors as an XML [Bean] containing a sub-element for each error.

setXmlErrors

public void setXmlErrors(XmlErrors errors)
Set the errors XML for this wrapper.

Parameters:
errors - the XML encapsulating the errors reported by the last invoked operation on this wrapper.
See Also:
for more details.