Top Description Fields Constructors Methods
org.springframework.messaging.support

public abstract Class AbstractHeaderMapper<T>

extends Object
implements HeaderMapper<T>
Class Inheritance
All Implemented Interfaces
org.springframework.messaging.support.HeaderMapper
Type Parameters
<T>
type of the instance to and from which headers will be mapped
Imports
java.util.Map, org.apache.commons.logging.Log, .LogFactory, org.springframework.lang.Nullable, org.springframework.messaging.MessageHeaders, org.springframework.util.StringUtils

A base HeaderMapper implementation.
Author
Stephane Nicoll
Since
4.1

Field Summary

Modifier and TypeField and Description
private String
protected final Log
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String
fromHeaderName(String headerName)

Generate the name to use to set the header defined by the specified headerName to the protocol specific message.

protected <V> V
getHeaderIfAvailable(Map<String, Object> headers, String name, Class<V> type)

Return the header value, or null if it does not exist or does not match the requested type.

public void
setInboundPrefix(String inboundPrefix)

Specify a prefix to be appended to the message header name for any user-defined property that is being mapped into the MessageHeaders.

public void
setOutboundPrefix(String outboundPrefix)

Specify a prefix to be appended to the protocol property name for any user-defined message header that is being mapped into the protocol-specific Message.

protected String
toHeaderName(String propertyName)

Generate the name to use to set the header defined by the specified propertyName to the MessageHeaders instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inboundPrefixback to summary
private String inboundPrefix
loggerback to summary
protected final Log logger
outboundPrefixback to summary
private String outboundPrefix

Constructor Detail

AbstractHeaderMapperback to summary
public AbstractHeaderMapper()

Method Detail

fromHeaderNameback to summary
protected String fromHeaderName(String headerName)

Generate the name to use to set the header defined by the specified headerName to the protocol specific message.

See Also
setOutboundPrefix
getHeaderIfAvailableback to summary
protected <V> V getHeaderIfAvailable(Map<String, Object> headers, String name, Class<V> type)

Return the header value, or null if it does not exist or does not match the requested type.

Annotations
@Nullable
setInboundPrefixback to summary
public void setInboundPrefix(String inboundPrefix)

Specify a prefix to be appended to the message header name for any user-defined property that is being mapped into the MessageHeaders. The default is an empty String (no prefix).

setOutboundPrefixback to summary
public void setOutboundPrefix(String outboundPrefix)

Specify a prefix to be appended to the protocol property name for any user-defined message header that is being mapped into the protocol-specific Message. The default is an empty String (no prefix).

toHeaderNameback to summary
protected String toHeaderName(String propertyName)

Generate the name to use to set the header defined by the specified propertyName to the MessageHeaders instance.

See Also
setInboundPrefix(String)