|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Transformer
Transformer
can be chained together to covert message payloads
from one object type to another.
Field Summary |
---|
Fields inherited from interface org.mule.api.lifecycle.Initialisable |
---|
PHASE_NAME |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Method Summary | |
---|---|
String |
getEncoding()
Return the encoding returned by the transformer (if any). |
ImmutableEndpoint |
getEndpoint()
Deprecated. |
String |
getMimeType()
Return the mime type returned by the transformer (if any). |
Class<?> |
getReturnClass()
Deprecated. use getReturnDataType() instead. |
DataType<?> |
getReturnDataType()
Specifies the return type of the result after this transformer has been executed. |
List<DataType<?>> |
getSourceDataTypes()
Returns an unmodifiable list of Source types registered on this transformer |
List<Class<?>> |
getSourceTypes()
Deprecated. use getSourceDataTypes() instead |
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(DataType<?> dataType)
Determines if a particular source class can be handled by this transformer |
boolean |
isSourceTypeSupported(Class<?> aClass)
Deprecated. use isSourceDataTypeSupported(org.mule.api.transformer.DataType) instead |
void |
setReturnClass(Class<?> theClass)
Deprecated. use setReturnDataType(DataType) instead |
void |
setReturnDataType(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,
String encoding)
Transforms the supplied data and returns the result |
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.NameableObject |
---|
setName |
Methods inherited from interface org.mule.api.NamedObject |
---|
getName |
Methods inherited from interface org.mule.api.context.MuleContextAware |
---|
setMuleContext |
Methods inherited from interface org.mule.endpoint.EndpointAware |
---|
setEndpoint |
Method Detail |
---|
@Deprecated boolean isSourceTypeSupported(Class<?> aClass)
isSourceDataTypeSupported(org.mule.api.transformer.DataType)
instead
aClass
- The class to check for compatibility
boolean isSourceDataTypeSupported(DataType<?> dataType)
dataType
- The DataType to check for compatibility
@Deprecated List<Class<?>> getSourceTypes()
getSourceDataTypes()
instead
List<DataType<?>> getSourceDataTypes()
boolean isAcceptNull()
boolean isIgnoreBadInput()
Object transform(Object src) throws TransformerException
src
- the data to transform
TransformerException
- if a error occurs transforming the data or if the
expected returnClass isn't the same as the transformed dataObject transform(Object src, String encoding) throws TransformerException
src
- 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 encoding
TransformerException
- if a error occurs transforming the data or if the
expected returnClass isn't the same as the transformed data@Deprecated void setReturnClass(Class<?> theClass)
setReturnDataType(DataType)
instead
TransformerException
will be
thrown.
theClass
- the expected return type class@Deprecated Class<?> getReturnClass()
getReturnDataType()
instead.
void setReturnDataType(DataType<?> type)
TransformerException
will be
thrown.
This method supersedes getReturnClass()
because it allows Generics information to be associated with the
return type of the transformer
type
- the expected return type for this transformerDataType<?> getReturnDataType()
getReturnClass()
because it allows Generics information to be associated with the
return type of the transformer
String getMimeType()
String getEncoding()
ImmutableEndpoint getEndpoint()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |