|
||||||||||
| 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 |
| Method Summary | |
|---|---|
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)
Thransforms the supplied data and returns the result |
Object |
transform(Object src,
String encoding)
Thransforms the supplied data and returns the result |
| Methods inherited from interface org.mule.api.transformer.BaseTransformer |
|---|
getEndpoint, setEndpoint |
| Methods inherited from interface org.mule.api.lifecycle.Initialisable |
|---|
initialise |
| Methods inherited from interface org.mule.api.NamedObject |
|---|
getName, setName |
| Methods inherited from interface org.mule.api.context.MuleContextAware |
|---|
setMuleContext |
| Method Detail |
|---|
boolean isSourceTypeSupported(Class aClass)
isSourceDataTypeSupported(org.mule.api.transformer.DataType) instead
aClass - The class to check for compatability
boolean isSourceDataTypeSupported(DataType dataType)
dataType - The DataType to check for compatability
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 data
Object 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 datavoid setReturnClass(Class theClass)
setReturnDataType(DataType) instead
TransformerException will be
thrown.
theClass - the expected return type classClass getReturnClass()
getReturnDataType() instead.
void setReturnDataType(DataType type)
TransformerException will be
thrown.
This method superseeds 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||