Save This Page
Home » spring-ws-1.5.9-with-dependencies » org.springframework » oxm » support » [javadoc | source]
org.springframework.oxm.support
public class: MarshallingMessageConverter [javadoc | source]
java.lang.Object
   org.springframework.oxm.support.MarshallingMessageConverter

All Implemented Interfaces:
    org.springframework.jms.support.converter.MessageConverter, org.springframework.beans.factory.InitializingBean

Spring JMS MessageConverter that uses a Marshaller and Unmarshaller . Marshals an object to a BytesMessage , or to a TextMessage if the marshalTo is set to #MARSHAL_TO_TEXT_MESSAGE . Unmarshals from a TextMessage or BytesMessage to an object.
Field Summary
public static final  int MARSHAL_TO_BYTES_MESSAGE    Constant that indicates that #toMessage(Object, Session) should marshal to a BytesMessage
public static final  int MARSHAL_TO_TEXT_MESSAGE    Constant that indicates that #toMessage(Object, Session) should marshal to a TextMessage
Constructor:
 public MarshallingMessageConverter() 
 public MarshallingMessageConverter(Marshaller marshaller) 
    Constructs a new MarshallingMessageConverter with the given Marshaller set. If the given Marshaller also implements the Unmarshaller interface, it is used for both marshalling and unmarshalling. Otherwise, an exception is thrown.

    Note that all Marshaller implementations in Spring-WS also implement the Unmarshaller interface, so that you can safely use this constructor.

    Parameters:
    marshaller - object used as marshaller and unmarshaller
    Throws:
    IllegalArgumentException - when marshaller does not implement the Unmarshaller interface
 public MarshallingMessageConverter(Marshaller marshaller,
    Unmarshaller unmarshaller) 
    Creates a new MarshallingMessageConverter with the given marshaller and unmarshaller.
    Parameters:
    marshaller - the marshaller to use
    unmarshaller - the unmarshaller to use
Method from org.springframework.oxm.support.MarshallingMessageConverter Summary:
afterPropertiesSet,   fromMessage,   marshalToBytesMessage,   marshalToMessage,   marshalToTextMessage,   setMarshalTo,   setMarshaller,   setUnmarshaller,   toMessage,   unmarshalFromBytesMessage,   unmarshalFromMessage,   unmarshalFromTextMessage
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.oxm.support.MarshallingMessageConverter Detail:
 public  void afterPropertiesSet() throws Exception 
 public Object fromMessage(Message message) throws JMSException, MessageConversionException 
    Unmarshals the given Message into an object.
 protected BytesMessage marshalToBytesMessage(Object object,
    Session session,
    Marshaller marshaller) throws JMSException, IOException 
 protected Message marshalToMessage(Object object,
    Session session,
    Marshaller marshaller) throws JMSException, IOException 
 protected TextMessage marshalToTextMessage(Object object,
    Session session,
    Marshaller marshaller) throws JMSException, IOException 
 public  void setMarshalTo(int marshalTo) 
 public  void setMarshaller(Marshaller marshaller) 
    Sets the Marshaller to be used by this message converter.
 public  void setUnmarshaller(Unmarshaller unmarshaller) 
 public Message toMessage(Object object,
    Session session) throws JMSException, MessageConversionException 
 protected Object unmarshalFromBytesMessage(BytesMessage message,
    Unmarshaller unmarshaller) throws JMSException, IOException 
 protected Object unmarshalFromMessage(Message message,
    Unmarshaller unmarshaller) throws JMSException, IOException 
 protected Object unmarshalFromTextMessage(TextMessage message,
    Unmarshaller unmarshaller) throws JMSException, IOException