Spring Integration

org.springframework.integration.transformer
Class HeaderEnricher

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

public class HeaderEnricher
extends Object
implements Transformer

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.

Author:
Mark Fisher

Nested Class Summary
static interface HeaderEnricher.HeaderValueMessageProcessor<T>
           
 
Constructor Summary
HeaderEnricher()
           
HeaderEnricher(Map<String,? extends HeaderEnricher.HeaderValueMessageProcessor<?>> headersToAdd)
          Create a HeaderEnricher with the given map of headers.
 
Method Summary
 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(Map<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

Spring Integration

Copyright © 2010. All Rights Reserved.