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
Class AbstractMessageTransformer

    java.lang.Object
      org.mule.transformer.AbstractTransformer
          org.mule.transformer.AbstractMessageTransformer

All Implemented Interfaces:
  MuleContextAware, MuleContextNotificationListener<MuleContextNotification>, ServerNotificationListener<MuleContextNotification>, Disposable, Initialisable, NamedObject, MessageProcessor, MessageTransformer, Transformer, EndpointAware

Direct Known Subclasses:
  AbstractExpressionTransformer, AbstractJmsTransformer, AbstractJsonTransformer, AbstractMessageAwareTransformer, AbstractXmlTransformer, AbstractXStreamTransformer, AnnotatedTransformerProxy, AutoTransformer, HttpRequestBodyToParamMap, HttpRequestToBook, HttpRequestToParameter, HttpRequestToParameterMap, MessagePropertiesTransformer, MuleMessageToByteArray, MuleMessageToHttpResponse, ObjectToHttpClientMethodRequest, ObjectToXmppPacket, ScriptTransformer, StringToEmailMessage, TransformerChain, TransformerTemplate, XmppPacketToObject

    public abstract class AbstractMessageTransformer

extends AbstractTransformer
implements MessageTransformer

`AbstractMessageTransformer` is a transformer that has a reference to the current message. This message can be used to obtain properties associated with the current message which are useful to the transform. Note that when part of a transform chain, the MuleMessage payload reflects the pre-transform message state, unless there is no current event for this thread, then the message will be a new DefaultMuleMessage with the src as its payload. Transformers should always work on the src object not the message payload.

See Also:
  `MuleMessage`, `DefaultMuleMessage`

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
`AbstractMessageTransformer()`

Method Summary
`protected Object` | `checkReturnClass(Object object, MuleEvent event)` Check if the return class is supported by this transformer
`Object` | `doTransform(Object src, String enc)` Perform a non-message aware transform.
`boolean` | `isSourceDataTypeSupported(DataType<?> dataType, boolean exactMatch)` Determines whether that data type passed in is supported by this transformer
`Object` | `transform(Object src, MuleEvent event)` transform the specified message
`Object` | `transform(Object src, String enc)` Transform the message with no event specified.
`Object` | `transform(Object src, String enc, MuleEvent event)` transform the specified message
`abstract Object` | `transformMessage(MuleMessage message, String outputEncoding)` Transform the message

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
`clone, 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

### AbstractMessageTransformer

    public AbstractMessageTransformer()

Method Detail

### isSourceDataTypeSupported

    public boolean isSourceDataTypeSupported(DataType<?> dataType,
                                             boolean exactMatch)

  Description copied from class: `AbstractTransformer`
  Determines whether that data type passed in is supported by this transformer

  Overrides:
    `isSourceDataTypeSupported` in class `AbstractTransformer`
  Parameters:
    `dataType` - the type to check against
    `exactMatch` - if set to true, this method will look for an exact match to the data type, if false it will look for a compatible data type.
  Returns:
    whether the data type is supported

### doTransform

    public final Object doTransform(Object src,
                                    String enc)
                             throws TransformerException

  Perform a non-message aware transform. This should never be called

  Specified by:
    `doTransform` in class `AbstractTransformer`
  Throws:
    `TransformerException`

### transform

    public final Object transform(Object src,
                                  String enc)
                           throws TransformerException

  Transform the message with no event specified.

  Specified by:
    `transform` in interface `Transformer`
  Overrides:
    `transform` in class `AbstractTransformer`
  Parameters:
    `src` - the data to transform
    `enc` - the encoding to use by this transformer. many transformations will not need encoding unless dealing with text so you only need to use this method if yo wish to customize the encoding
  Returns:
    the transformed data
  Throws:
    `TransformerException` - if a error occurs transforming the data or if the expected returnClass isn't the same as the transformed data

### transform

    public Object transform(Object src,
                            MuleEvent event)
                     throws TransformerMessagingException

  transform the specified message

  Specified by:
    `transform` in interface `MessageTransformer`
  Parameters:
    `src` - the data to transform
    `event` - the event currently being processed
  Returns:
  Throws:
    `TransformerMessagingException`

### transform

    public final Object transform(Object src,
                                  String enc,
                                  MuleEvent event)
                           throws TransformerMessagingException

  transform the specified message

  Specified by:
    `transform` in interface `MessageTransformer`
  Parameters:
    `src` - the data to transform
    `enc` -
    `event` - the event currently being processed
  Returns:
  Throws:
    `TransformerMessagingException`

### checkReturnClass

    protected Object checkReturnClass(Object object,
                                      MuleEvent event)
                               throws TransformerMessagingException

  Check if the return class is supported by this transformer

  Parameters:
    `object` -
    `event` -
  Returns:
  Throws:
    `TransformerMessagingException`

### transformMessage

    public abstract Object transformMessage(MuleMessage message,
                                            String outputEncoding)
                                     throws TransformerException

  Transform the message

  Parameters:
    `message` -
    `outputEncoding` -
  Returns:
  Throws:
    `TransformerMessagingException`
    `TransformerException`

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.