org.springframework.integration.transformer
Class HeaderEnricher

java.lang.Object
  extended by org.springframework.integration.transformer.HeaderEnricher
All Implemented Interfaces:
BeanNameAware, InitializingBean, Transformer
Direct Known Subclasses:
XPathHeaderEnricher

public class HeaderEnricher
extends java.lang.Object
implements Transformer, BeanNameAware, InitializingBean

A Transformer that adds statically configured header values to a Message. Accepts the boolean 'overwrite' property that specifies whether values should be overwritten. By default, any existing header values for a given key, will not be replaced.


Nested Class Summary
static interface HeaderEnricher.HeaderValueMessageProcessor<T>
           
 
Constructor Summary
HeaderEnricher()
           
HeaderEnricher(java.util.Map<java.lang.String,? extends HeaderEnricher.HeaderValueMessageProcessor<?>> headersToAdd)
          Create a HeaderEnricher with the given map of headers.
 
Method Summary
 void afterPropertiesSet()
           
 void setBeanName(java.lang.String beanName)
           
 void setDefaultOverwrite(boolean defaultOverwrite)
           
<T> void
setMessageProcessor(MessageProcessor<T> messageProcessor)
           
 void setShouldSkipNulls(boolean shouldSkipNulls)
          Specify whether null values, such as might be returned from an expression evaluation, should be skipped.
 Message<?> transform(Message<?> message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderEnricher

public HeaderEnricher()

HeaderEnricher

public HeaderEnricher(java.util.Map<java.lang.String,? extends HeaderEnricher.HeaderValueMessageProcessor<?>> headersToAdd)
Create a HeaderEnricher with the given map of headers.

Method Detail

setMessageProcessor

public <T> void setMessageProcessor(MessageProcessor<T> messageProcessor)

setDefaultOverwrite

public void setDefaultOverwrite(boolean defaultOverwrite)

setShouldSkipNulls

public void setShouldSkipNulls(boolean shouldSkipNulls)
Specify whether null values, such as might be returned from an expression evaluation, should be skipped. The default value is true. Set this to false if a null value should trigger removal of the corresponding header instead.


transform

public Message<?> transform(Message<?> message)
Specified by:
transform in interface Transformer

setBeanName

public void setBeanName(java.lang.String beanName)
Specified by:
setBeanName in interface BeanNameAware

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
java.lang.Exception