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:
- AnnotatedObject, MuleContextAware, Disposable, Initialisable, NameableObject, NamedObject, MessageProcessor, MessageTransformer, Transformer, EndpointAware
public class MessagePropertiesTransformer
- extends AbstractMessageTransformer
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 |
dispose, generateTransformerName, getAnnotation, getAnnotations, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, initialise, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, process, registerSourceType, registerSourceType, setAllowNullReturn, setAnnotations, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, 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
transformMessage
public Object transformMessage(MuleMessage message,
String outputEncoding)
- Description copied from class:
AbstractMessageTransformer
- Transform the message
- Specified by:
transformMessage
in class AbstractMessageTransformer
deleteProperties
protected void deleteProperties(MuleMessage message)
addProperties
protected void addProperties(MuleMessage message)
renameProperties
protected void renameProperties(MuleMessage message)
renameInScope
protected void renameInScope(String oldKey,
String newKey,
PropertyScope propertyScope,
MuleMessage message)
getDeleteProperties
public List<String> getDeleteProperties()
setDeleteProperties
public void setDeleteProperties(List<String> deleteProperties)
- See Also:
setDeleteProperties(String...)
setDeleteProperties
public void setDeleteProperties(String... deleteProperties)
getAddProperties
public Map<String,Object> getAddProperties()
setAddProperties
public void setAddProperties(Map<String,Object> addProperties)
getRenameProperties
public Map<String,String> 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
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.