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 Message payload reflects the pre-transform message state, unless there is no current event for this thread, then the
message will be a new Message with the src as its payload. Transformers should always work on the src object not the
message payload.InternalMessageReactiveProcessor.ProcessingTypelogger, muleContext, name, sourceTypes| Constructor and Description |
|---|
AbstractMessageTransformer() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
checkReturnClass(Object object,
Event event)
Check if the return class is supported by this transformer
|
Object |
doTransform(Object src,
Charset enc)
Perform a non-message aware transform.
|
boolean |
isSourceDataTypeSupported(org.mule.runtime.api.metadata.DataType dataType,
boolean exactMatch)
Determines whether that data type passed in is supported by this transformer
|
Object |
transform(Object src,
Charset enc)
Transform the message with no event specified.
|
Object |
transform(Object src,
Charset enc,
Event event)
Transforms the supplied data and returns the result
|
Object |
transform(Object src,
Event event)
Transforms the supplied data and returns the result
|
abstract Object |
transformMessage(Event event,
Charset outputEncoding)
Transform the message
|
dispose, generateTransformerName, getName, getReturnDataType, getSourceDataTypes, initialise, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, process, registerSourceType, resolveEncoding, setAllowNullReturn, setIgnoreBadInput, setMuleContext, setName, setReturnDataType, toString, transform, unregisterSourceTypegetAnnotation, getAnnotations, getLocation, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetProcessingType, getReturnDataType, getSourceDataTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, setReturnDataType, transformsetMuleContextpublic boolean isSourceDataTypeSupported(org.mule.runtime.api.metadata.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, Charset enc) throws TransformerException
doTransform in class AbstractTransformerTransformerExceptionpublic final Object transform(Object src, Charset 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, Event event) throws MessageTransformerException
MessageTransformertransform in interface MessageTransformersrc - the data to transformevent - the event currently being processedMessageTransformerException - 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, Charset enc, Event event) throws MessageTransformerException
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 processedMessageTransformerException - if a error occurs transforming the data or if the expected returnClass isn't the same as
the transformed dataprotected Object checkReturnClass(Object object, Event event) throws MessageTransformerException
MessageTransformerExceptionpublic abstract Object transformMessage(Event event, Charset outputEncoding) throws TransformerException
TransformerExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.