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.MuleMessage,
DefaultMuleMessageencoding, endpoint, logger, mimeType, MULE_MESSAGE_DATA_TYPE, muleContext, name, returnType, sourceTypesPHASE_NAMEPHASE_NAMEPROPERTY_NAME| Constructor and Description |
|---|
AbstractMessageTransformer() |
| Modifier and Type | Method and Description |
|---|---|
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)
Thransforms the supplied data and returns the result
|
Object |
transform(Object src,
String enc)
Transform the message with no event specified.
|
Object |
transform(Object src,
String enc,
MuleEvent event)
Thransforms the supplied data and returns the result
|
abstract Object |
transformMessage(MuleMessage message,
String outputEncoding)
Transform the message
|
dispose, generateTransformerName, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, initialise, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, process, registerSourceType, registerSourceType, setAllowNullReturn, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceTypegetAnnotation, getAnnotations, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transformprocessinitialisedisposesetNamegetNamesetMuleContextsetEndpointpublic boolean isSourceDataTypeSupported(DataType<?> dataType, boolean exactMatch)
AbstractTransformerisSourceDataTypeSupported in class AbstractTransformerdataType - the type to check againstexactMatch - 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.public final Object doTransform(Object src, String enc) throws TransformerException
doTransform in class AbstractTransformerTransformerExceptionpublic final Object transform(Object src, String enc) throws TransformerException
transform in interface Transformertransform in class AbstractTransformersrc - the data to transformenc - 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 encodingTransformerException - if a error occurs transforming the data or if the
expected returnClass isn't the same as the transformed datapublic Object transform(Object src, MuleEvent event) throws TransformerMessagingException
MessageTransformertransform in interface MessageTransformersrc - the data to transformevent - the event currently being processedTransformerMessagingException - if a error occurs transforming the data or if the
expected returnClass isn't the same as the transformed datapublic final Object transform(Object src, String enc, MuleEvent event) throws TransformerMessagingException
MessageTransformertransform in interface MessageTransformersrc - the data to transformenc - 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 encodingevent - the event currently being processedTransformerMessagingException - if a error occurs transforming the data or if the
expected returnClass isn't the same as the transformed dataprotected Object checkReturnClass(Object object, MuleEvent event) throws TransformerMessagingException
TransformerMessagingExceptionpublic abstract Object transformMessage(MuleMessage message, String outputEncoding) throws TransformerException
TransformerExceptionCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.