org.springframework.jms.support.converter

## Interface SmartMessageConverter

All Superinterfaces:
  MessageConverter

All Known Implementing Classes:
  MappingJackson2MessageConverter

    public interface SmartMessageConverter
    extends MessageConverter

An extended `MessageConverter` SPI with conversion hint support.

In case of a conversion hint being provided, the framework will call the extended method if a converter implements this interface, instead of calling the regular `toMessage` variant.

Since:
  4.3
Author:
  Stephane Nicoll

### Method Summary

All Methods Instance Methods Abstract Methods
`Message` `toMessage(Object object, Session session, Object conversionHint)` A variant of `MessageConverter.toMessage(Object, Session)` which takes an extra conversion context as an argument, allowing to take e.g.

### Methods inherited from interface org.springframework.jms.support.converter.MessageConverter

`fromMessage, toMessage`

### Method Detail

#### toMessage

    Message toMessage(Object object,
                      Session session,
                      @Nullable
                      Object conversionHint)
               throws JMSException,
                      MessageConversionException

A variant of `MessageConverter.toMessage(Object, Session)` which takes an extra conversion context as an argument, allowing to take e.g. annotations on a payload parameter into account.

Parameters:
  `object` - the object to convert
  `session` - the Session to use for creating a JMS Message
  `conversionHint` - an extra object passed to the `MessageConverter`, e.g. the associated `MethodParameter` (may be `null`}
Returns:
  the JMS Message
Throws:
  `JMSException` - if thrown by JMS API methods
  `MessageConversionException` - in case of conversion failure
See Also:
  `MessageConverter.toMessage(Object, Session)`