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
.
encoding, endpoint, logger, mimeType, MULE_MESSAGE_DATA_TYPE, muleContext, name, returnType, sourceTypes
PHASE_NAME
PHASE_NAME
PROPERTY_NAME
Constructor and Description |
---|
MessagePropertiesTransformer() |
checkReturnClass, doTransform, isSourceDataTypeSupported, transform, transform, transform
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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform
process
initialise
dispose
setName
getName
setMuleContext
setEndpoint
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public Object transformMessage(MuleMessage message, String outputEncoding)
AbstractMessageTransformer
transformMessage
in class AbstractMessageTransformer
protected void deleteProperties(MuleMessage message)
protected void addProperties(MuleMessage message)
protected void renameProperties(MuleMessage message)
protected void renameInScope(String oldKey, String newKey, PropertyScope propertyScope, MuleMessage message)
public void setDeleteProperties(List<String> deleteProperties)
setDeleteProperties(String...)
public void setDeleteProperties(String... deleteProperties)
public void setRenameProperties(Map<String,String> renameProperties)
renameProperties
- the renameProperties to setpublic String getGetProperty()
public void setGetProperty(String getProperty)
public boolean isOverwrite()
public void setOverwrite(boolean overwrite)
public PropertyScope getScope()
public void setScope(PropertyScope scope)
public String getScopeName()
PropertyScope
public void setScopeName(String scopeName)
scopeName
- The string value name for a PropertyScope
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.