org.mule.transformer.simple
Class MessagePropertiesTransformer
java.lang.Object
org.mule.transformer.AbstractTransformer
org.mule.transformer.AbstractMessageAwareTransformer
org.mule.transformer.simple.MessagePropertiesTransformer
- All Implemented Interfaces:
- MuleContextAware, Initialisable, NamedObject, BaseTransformer, Transformer
public class MessagePropertiesTransformer
- extends AbstractMessageAwareTransformer
- implements MuleContextAware
A configurable message transformer that allows users to add, overwrite and delete
properties on the current message. Users can set a List
of
'deleteProperties' names to remove from the message and can also set a Map
of 'addProperties' that will be added to the message and possibly overwrite
existing properties with the same name.
If overwrite
is set to
false
, and a property exists on the message (even if the value is
null
, it will be left intact. The transformer then acts as a more
gentle 'enricher'. The default setting is true
.
Methods inherited from class org.mule.transformer.AbstractTransformer |
checkReturnClass, generateTransformerName, getEndpoint, getName, getReturnClass, getSourceTypes, initialise, isAcceptNull, isConsumed, isIgnoreBadInput, isSourceTypeSupported, registerSourceType, setEndpoint, setIgnoreBadInput, setName, setReturnClass, toString, transform, unregisterSourceType |
MessagePropertiesTransformer
public MessagePropertiesTransformer()
clone
public Object clone()
throws CloneNotSupportedException
- Overrides:
clone
in class Object
- Throws:
CloneNotSupportedException
setMuleContext
public void setMuleContext(MuleContext context)
- Specified by:
setMuleContext
in interface MuleContextAware
transform
public Object transform(MuleMessage message,
String outputEncoding)
throws TransformerException
- Specified by:
transform
in class AbstractMessageAwareTransformer
- Throws:
TransformerException
getDeleteProperties
public List getDeleteProperties()
setDeleteProperties
public void setDeleteProperties(List deleteProperties)
getAddProperties
public Map getAddProperties()
setAddProperties
public void setAddProperties(Map addProperties)
getRenameProperties
public Map getRenameProperties()
- Returns:
- the renameProperties
setRenameProperties
public void setRenameProperties(Map renameProperties)
- Parameters:
renameProperties
- the renameProperties to set
isOverwrite
public boolean isOverwrite()
setOverwrite
public void setOverwrite(boolean overwrite)
Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.