public abstract class AbstractFromMessageConverter
extends org.springframework.messaging.converter.AbstractMessageConverter
MessageConverters
used with custom Message conversion. Only AbstractMessageConverter.fromMessage(org.springframework.messaging.Message<?>, java.lang.Class<?>)
is supported.Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
protected List<org.springframework.util.MimeType> |
targetMimeTypes |
Modifier | Constructor and Description |
---|---|
protected |
AbstractFromMessageConverter(Collection<org.springframework.util.MimeType> targetMimeTypes) |
protected |
AbstractFromMessageConverter(Collection<org.springframework.util.MimeType> supportedSourceMimeTypes,
Collection<org.springframework.util.MimeType> targetMimeTypes)
Creates a converter that handles one or more content-type message headers and one
or more target MIME types
|
protected |
AbstractFromMessageConverter(Collection<org.springframework.util.MimeType> supportedSourceMimeTypes,
org.springframework.util.MimeType targetMimeType)
Creates a converter that handles one or more content-type message headers
|
protected |
AbstractFromMessageConverter(org.springframework.util.MimeType targetMimeType)
Creates a converter that ignores content-type message headers
|
protected |
AbstractFromMessageConverter(org.springframework.util.MimeType supportedSourceMimeType,
Collection<org.springframework.util.MimeType> targetMimeTypes)
Creates a converter that requires a specific content-type message header and
supports multiple target MIME types.
|
protected |
AbstractFromMessageConverter(org.springframework.util.MimeType supportedSourceMimeType,
org.springframework.util.MimeType targetMimeType)
Creates a converter that requires a specific content-type message header
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canConvertFrom(org.springframework.messaging.Message<?> message,
Class<?> targetClass) |
protected boolean |
canConvertTo(Object payload,
org.springframework.messaging.MessageHeaders headers)
Not supported by default
|
Object |
convertToInternal(Object payload,
org.springframework.messaging.MessageHeaders headers,
Object conversionHint)
Not supported by default
|
protected abstract Class<?>[] |
supportedPayloadTypes()
Subclasses implement this to specify supported payload types
|
protected abstract Class<?>[] |
supportedTargetTypes()
Subclasses implement this to specify supported target types
|
protected boolean |
supports(Class<?> clazz) |
protected boolean |
supportsPayloadType(Class<?> clazz) |
boolean |
supportsTargetMimeType(org.springframework.util.MimeType mimeType) |
convertFromInternal, convertFromInternal, convertToInternal, fromMessage, fromMessage, getContentTypeResolver, getDefaultContentType, getMimeType, getSerializedPayloadClass, getSupportedMimeTypes, isStrictContentTypeMatch, setContentTypeResolver, setSerializedPayloadClass, setStrictContentTypeMatch, supportsMimeType, toMessage, toMessage
protected final org.apache.commons.logging.Log logger
protected final List<org.springframework.util.MimeType> targetMimeTypes
protected AbstractFromMessageConverter(org.springframework.util.MimeType targetMimeType)
targetMimeType
- the required target typeprotected AbstractFromMessageConverter(Collection<org.springframework.util.MimeType> targetMimeTypes)
protected AbstractFromMessageConverter(Collection<org.springframework.util.MimeType> supportedSourceMimeTypes, org.springframework.util.MimeType targetMimeType)
supportedSourceMimeTypes
- list of MimeType
that may present in
content-type headertargetMimeType
- the required target typeprotected AbstractFromMessageConverter(Collection<org.springframework.util.MimeType> supportedSourceMimeTypes, Collection<org.springframework.util.MimeType> targetMimeTypes)
supportedSourceMimeTypes
- a list of supported content typestargetMimeTypes
- a list of supported target typesprotected AbstractFromMessageConverter(org.springframework.util.MimeType supportedSourceMimeType, org.springframework.util.MimeType targetMimeType)
supportedSourceMimeType
- MimeType
that must be present in
content-type headertargetMimeType
- the required target typeprotected AbstractFromMessageConverter(org.springframework.util.MimeType supportedSourceMimeType, Collection<org.springframework.util.MimeType> targetMimeTypes)
supportedSourceMimeType
- MimeType
that must be present in
content-type headertargetMimeTypes
- a list of supported target typesprotected abstract Class<?>[] supportedTargetTypes()
protected abstract Class<?>[] supportedPayloadTypes()
protected boolean supportsPayloadType(Class<?> clazz)
protected boolean supports(Class<?> clazz)
supports
in class org.springframework.messaging.converter.AbstractMessageConverter
protected boolean canConvertFrom(org.springframework.messaging.Message<?> message, Class<?> targetClass)
canConvertFrom
in class org.springframework.messaging.converter.AbstractMessageConverter
public boolean supportsTargetMimeType(org.springframework.util.MimeType mimeType)
protected boolean canConvertTo(Object payload, org.springframework.messaging.MessageHeaders headers)
canConvertTo
in class org.springframework.messaging.converter.AbstractMessageConverter
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.