org.mule.transformer.simple
Class MessagePropertiesTransformer
java.lang.Object
org.mule.transformer.AbstractTransformer
org.mule.transformer.AbstractMessageTransformer
org.mule.transformer.simple.MessagePropertiesTransformer
- All Implemented Interfaces:
- MuleContextAware, MuleContextNotificationListener<MuleContextNotification>, ServerNotificationListener<MuleContextNotification>, Disposable, Initialisable, NamedObject, MessageProcessor, MessageTransformer, Transformer, EndpointAware
public class MessagePropertiesTransformer
- extends AbstractMessageTransformer
- implements MuleContextAware
A configurable message transformer that allows users to add, overwrite, rename and delete
properties on the current message. Users can set a List of
'deleteProperties' regular expressions to remove the matching properties
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, dispose, generateTransformerName, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, initialise, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, onNotification, process, registerSourceType, registerSourceType, setAllowNullReturn, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceType |
| Methods inherited from interface org.mule.api.transformer.Transformer |
getEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform |
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- Overrides:
setMuleContext in class AbstractTransformer
transformMessage
public Object transformMessage(MuleMessage message,
String outputEncoding)
- Description copied from class:
AbstractMessageTransformer
- Transform the message
- Specified by:
transformMessage in class AbstractMessageTransformer
- Returns:
renameInScope
protected void renameInScope(String oldKey,
String newKey,
PropertyScope scope,
MuleMessage message)
getDeleteProperties
public List getDeleteProperties()
setDeleteProperties
public void setDeleteProperties(List<String> deleteProperties)
- See Also:
setDeleteProperties(String...)
setDeleteProperties
public void setDeleteProperties(String... deleteProperties)
getAddProperties
public Map getAddProperties()
setAddProperties
public void setAddProperties(Map<String,Object> addProperties)
getRenameProperties
public Map getRenameProperties()
- Returns:
- the renameProperties
setRenameProperties
public void setRenameProperties(Map<String,String> renameProperties)
- Parameters:
renameProperties - the renameProperties to set
getGetProperty
public String getGetProperty()
setGetProperty
public void setGetProperty(String getProperty)
isOverwrite
public boolean isOverwrite()
setOverwrite
public void setOverwrite(boolean overwrite)
getScope
public PropertyScope getScope()
setScope
public void setScope(PropertyScope scope)
getScopeName
public String getScopeName()
- For XML-based config
- Returns:
- The string value name for a
PropertyScope
setScopeName
public void setScopeName(String scopeName)
- For XML-based config
- Parameters:
scopeName - The string value name for a PropertyScope
deleteProperties
protected void deleteProperties(MuleMessage message)
renameProperties
protected void renameProperties(MuleMessage message)
Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.