public class CompositeConverter extends org.mule.runtime.api.meta.AbstractAnnotatedObject implements Converter, MuleContextAware
transform(Object) is called each converter in the same order they are included in the composition. The output of
a given converter is the input of the next composed converter.ReactiveProcessor.ProcessingTypeDEFAULT_PRIORITY_WEIGHTING, MAX_PRIORITY_WEIGHTING, MIN_PRIORITY_WEIGHTING| Constructor and Description |
|---|
CompositeConverter(Converter... converters)
Create a new conversion chain using the specified converters
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
LinkedList<Converter> |
getConverters() |
String |
getName() |
int |
getPriorityWeighting()
If two or more discoverable transformers are equal, this value can be used to select the correct one
|
org.mule.runtime.api.metadata.DataType |
getReturnDataType()
Specifies the return type of the result after this transformer has been executed.
|
List<org.mule.runtime.api.metadata.DataType> |
getSourceDataTypes()
Returns an unmodifiable list of Source types registered on this transformer
|
void |
initialise() |
boolean |
isAcceptNull()
Does this transformer allow null input?
|
boolean |
isIgnoreBadInput()
By default, Mule will throw an exception if a transformer is invoked with a source object that is not compatible with the
transformer.
|
boolean |
isSourceDataTypeSupported(org.mule.runtime.api.metadata.DataType dataType)
Determines if a particular source class can be handled by this transformer
|
Event |
process(Event event)
Invokes the MessageProcessor.
|
void |
setMuleContext(MuleContext context) |
void |
setName(String name) |
void |
setPriorityWeighting(int weighting)
If 2 or more discoverable transformers are equal, this value can be used to select the correct one
|
void |
setReturnDataType(org.mule.runtime.api.metadata.DataType type)
Sets the expected return type for the transformed data.
|
Object |
transform(Object src)
Transforms the supplied data and returns the result
|
Object |
transform(Object src,
Charset encoding)
Transforms the supplied data and returns the result
|
getAnnotation, getAnnotations, getLocation, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProcessingTypepublic CompositeConverter(Converter... converters)
converters - List of converters using to build the chainpublic boolean isSourceDataTypeSupported(org.mule.runtime.api.metadata.DataType dataType)
TransformerisSourceDataTypeSupported in interface TransformerdataType - The DataType to check for compatibilitypublic List<org.mule.runtime.api.metadata.DataType> getSourceDataTypes()
TransformergetSourceDataTypes in interface Transformerpublic boolean isAcceptNull()
TransformerisAcceptNull in interface Transformerpublic boolean isIgnoreBadInput()
TransformerisIgnoreBadInput in interface Transformerpublic Object transform(Object src) throws TransformerException
Transformertransform in interface Transformersrc - the data to transformTransformerException - if a error occurs transforming the data or if the expected returnClass isn't the same as the
transformed datapublic Object transform(Object src, Charset encoding) throws TransformerException
Transformertransform in interface Transformersrc - the data to transformencoding - 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 void setReturnDataType(org.mule.runtime.api.metadata.DataType type)
TransformerTransformerException will be thrown.setReturnDataType in interface Transformertype - the expected return type for this transformerpublic org.mule.runtime.api.metadata.DataType getReturnDataType()
TransformergetReturnDataType in interface Transformerpublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic Event process(Event event) throws org.mule.runtime.api.exception.MuleException
Processorpublic void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwarecontext - the Mule node.public void setName(String name)
setName in interface org.mule.runtime.api.meta.NameableObjectpublic String getName()
getName in interface org.mule.runtime.api.meta.NamedObjectpublic int getPriorityWeighting()
ConvertergetPriorityWeighting in interface ConverterConverter.MIN_PRIORITY_WEIGHTING and
Converter.MAX_PRIORITY_WEIGHTING.public void setPriorityWeighting(int weighting)
ConvertersetPriorityWeighting in interface Converterweighting - the priority weighting for this transformer. This is a value between Converter.MIN_PRIORITY_WEIGHTING and
Converter.MAX_PRIORITY_WEIGHTING.public LinkedList<Converter> getConverters()
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.