类 AbstractHeaderMapper<T>
- java.lang.Object
- org.springframework.messaging.support.AbstractHeaderMapper<T>
- 类型参数:
T
- type of the instance to and from which headers will be mapped
- 所有已实现的接口:
HeaderMapper<T>
- 直接已知子类:
SimpleJmsHeaderMapper
public abstract class AbstractHeaderMapper<T> extends Object implements HeaderMapper<T>
A baseHeaderMapper
implementation.- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll
构造器概要
构造器 构造器 说明 AbstractHeaderMapper()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected String
fromHeaderName(String headerName)
Generate the name to use to set the header defined by the specifiedheaderName
to the protocol specific message.protected <V> V
getHeaderIfAvailable(Map<String,Object> headers, String name, Class<V> type)
Return the header value, ornull
if it does not exist or does not match the requestedtype
.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.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 specifiedpropertyName
to theMessageHeaders
instance.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.messaging.support.HeaderMapper
fromHeaders, toHeaders
构造器详细资料
AbstractHeaderMapper
public AbstractHeaderMapper()
方法详细资料
setInboundPrefix
public void setInboundPrefix(@Nullable 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).
setOutboundPrefix
public void setOutboundPrefix(@Nullable 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).
fromHeaderName
protected String fromHeaderName(String headerName)
Generate the name to use to set the header defined by the specifiedheaderName
to the protocol specific message.
toHeaderName
protected String toHeaderName(String propertyName)
Generate the name to use to set the header defined by the specifiedpropertyName
to theMessageHeaders
instance.