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, BaseTransformer, MessageTransformer, Transformer

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

Field Summary

Fields inherited from class org.mule.transformer.AbstractTransformer
`encoding, endpoint, logger, mimeType, MULE_MESSAGE_DATA_TYPE, 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
`Object` | `clone()`
`protected void` | `deleteProperties(MuleMessage message)`
`Map` | `getAddProperties()`
`List` | `getDeleteProperties()`
`String` | `getGetProperty()`
`Map` | `getRenameProperties()`
`PropertyScope` | `getScope()`
`String` | `getScopeName()` For XML-based config
`boolean` | `isOverwrite()`
`protected void` | `renameInScope(String oldKey, String newKey, PropertyScope scope, 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` | `setMuleContext(MuleContext context)`
`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, 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, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform`

Methods inherited from interface org.mule.api.transformer.BaseTransformer
`getEndpoint, setEndpoint`

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`

Constructor Detail

### MessagePropertiesTransformer

    public MessagePropertiesTransformer()

Method Detail

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

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.