Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

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`.

Field Summary

Fields inherited from class org.mule.transformer.AbstractTransformer
`encoding, endpoint, logger, mimeType, MULE_MESSAGE_DATA_TYPE, muleContext, name, returnType, sourceTypes`

Fields inherited from interface org.mule.api.lifecycle.Initialisable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Constructor Summary
`MessagePropertiesTransformer()`

Method Summary
`protected void` | `addProperties(MuleMessage message)`
`Object` | `clone()`
`protected void` | `deleteProperties(MuleMessage message)`
`Map<String,Object>` | `getAddProperties()`
`List<String>` | `getDeleteProperties()`
`String` | `getGetProperty()`
`Map<String,String>` | `getRenameProperties()`
`PropertyScope` | `getScope()`
`String` | `getScopeName()` For XML-based config
`boolean` | `isOverwrite()`
`protected void` | `renameInScope(String oldKey, String newKey, PropertyScope propertyScope, MuleMessage message)`
`protected void` | `renameProperties(MuleMessage message)`
`void` | `setAddProperties(Map<String,Object> addProperties)`
`void` | `setDeleteProperties(List<String> deleteProperties)`
`void` | `setDeleteProperties(String... deleteProperties)`
`void` | `setGetProperty(String getProperty)`
`void` | `setOverwrite(boolean overwrite)`
`void` | `setRenameProperties(Map<String,String> renameProperties)`
`void` | `setScope(PropertyScope scope)`
`void` | `setScopeName(String scopeName)` For XML-based config
`Object` | `transformMessage(MuleMessage message, String outputEncoding)` Transform the message

Methods inherited from class org.mule.transformer.AbstractMessageTransformer
`checkReturnClass, doTransform, isSourceDataTypeSupported, transform, transform, transform`

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, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceType`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.mule.api.transformer.Transformer
`getEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform`

Methods inherited from interface org.mule.api.processor.MessageProcessor
`process`

Methods inherited from interface org.mule.api.lifecycle.Initialisable
`initialise`

Methods inherited from interface org.mule.api.lifecycle.Disposable
`dispose`

Methods inherited from interface org.mule.api.NamedObject
`getName, setName`

Methods inherited from interface org.mule.api.context.MuleContextAware
`setMuleContext`

Methods inherited from interface org.mule.endpoint.EndpointAware
`setEndpoint`

Constructor Detail

### MessagePropertiesTransformer

    public MessagePropertiesTransformer()

Method Detail

### 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`
  Returns:

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.