|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mule.transformers.AbstractTransformer
AbstractTransformer Is a base class for all transformers.
Transformations transform one object into another.
| Field Summary | |
protected UMOImmutableEndpoint |
endpoint
|
protected Log |
logger
logger used by this class |
protected String |
name
|
protected UMOTransformer |
nextTransformer
This is the following transformer in the chain of transformers. |
protected Class |
returnClass
|
protected List |
sourceTypes
|
static String |
TRANSFORMER_DEFAULT
The fully qualified class name of the fallback Transformer
implementation class to use, if no other can be found. |
| Fields inherited from interface org.mule.umo.transformer.UMOSimpleTransformer |
SERVICE_ID |
| Constructor Summary | |
AbstractTransformer()
default constructor required for discovery |
|
| Method Summary | |
protected Object |
checkReturnClass(Object object)
|
Object |
clone()
|
protected abstract Object |
doTransform(Object src,
String encoding)
|
protected String |
generateTransformerName()
|
UMOImmutableEndpoint |
getEndpoint()
|
Class |
getFinalReturnClass()
Will return the return type for the last transformer in the chain |
String |
getName()
|
UMOTransformer |
getNextTransformer()
|
Class |
getReturnClass()
|
String |
getSourceType()
Where multiple source types are listed, this method only returns the first one. |
protected Iterator |
getSourceTypeClassesIterator()
Deprecated. simply iterate over sourceTypes directly |
void |
initialise()
Template method were deriving classes can do any initialisation after the properties have been set on this transformer |
boolean |
isAcceptNull()
|
boolean |
isIgnoreBadInput()
|
boolean |
isSourceTypeSupported(Class aClass)
|
boolean |
isSourceTypeSupported(Class aClass,
boolean exactMatch)
|
protected void |
registerSourceType(Class aClass)
|
void |
setEndpoint(UMOImmutableEndpoint endpoint)
|
void |
setIgnoreBadInput(boolean ignoreBadInput)
|
void |
setName(String string)
|
void |
setNextTransformer(UMOTransformer nextTransformer)
|
void |
setReturnClass(Class newClass)
Sets the expected return type for the transformed data. |
void |
setSourceType(String type)
Convenience method to register source types using a bean property setter |
String |
toString()
|
Object |
transform(Object src)
Transforms the object. |
protected void |
unregisterSourceType(Class aClass)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String TRANSFORMER_DEFAULT
Transformer
implementation class to use, if no other can be found.
protected transient Log logger
protected Class returnClass
protected String name
protected UMOImmutableEndpoint endpoint
protected List sourceTypes
protected UMOTransformer nextTransformer
| Constructor Detail |
public AbstractTransformer()
| Method Detail |
protected Object checkReturnClass(Object object)
throws TransformerException
TransformerExceptionprotected void registerSourceType(Class aClass)
protected void unregisterSourceType(Class aClass)
protected Iterator getSourceTypeClassesIterator()
public String getName()
getName in interface UMOSimpleTransformerpublic void setName(String string)
setName in interface UMOSimpleTransformerstring - public Class getReturnClass()
getReturnClass in interface UMOSimpleTransformerpublic void setReturnClass(Class newClass)
UMOSimpleTransformerTransformerException will be
thrown.
setReturnClass in interface UMOSimpleTransformernewClass - the expected return type classpublic boolean isSourceTypeSupported(Class aClass)
isSourceTypeSupported in interface UMOTransformer
public boolean isSourceTypeSupported(Class aClass,
boolean exactMatch)
public final Object transform(Object src)
throws TransformerException
transform in interface UMOSimpleTransformersrc - The source object to transform.
TransformerException - if a error occurs transforming the data or if the
expected returnClass isn't the same as the transformed datapublic UMOImmutableEndpoint getEndpoint()
getEndpoint in interface UMOTransformerpublic void setEndpoint(UMOImmutableEndpoint endpoint)
setEndpoint in interface UMOTransformerendpoint - sets the endpoint associated with the transfromer
protected abstract Object doTransform(Object src,
String encoding)
throws TransformerException
TransformerExceptionpublic UMOTransformer getNextTransformer()
getNextTransformer in interface UMOSimpleTransformerpublic void setNextTransformer(UMOTransformer nextTransformer)
setNextTransformer in interface UMOSimpleTransformer
public Object clone()
throws CloneNotSupportedException
clone in interface UMOSimpleTransformerCloneNotSupportedExceptionpublic Class getFinalReturnClass()
public void initialise()
throws InitialisationException
initialise in interface InitialisableInitialisationExceptionprotected String generateTransformerName()
public void setSourceType(String type)
throws ClassNotFoundException
type - the fully qualified class name
ClassNotFoundException - is thrown if the class is not on theclasspathpublic String getSourceType()
getSourceTypesIterator()
public boolean isIgnoreBadInput()
public void setIgnoreBadInput(boolean ignoreBadInput)
public String toString()
public boolean isAcceptNull()
isAcceptNull in interface UMOTransformer
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||