|
|||||||||||
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 java.lang.String |
name
|
protected java.lang.Class |
returnClass
|
protected UMOTransformer |
transformer
|
static java.lang.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 java.lang.Object |
checkReturnClass(java.lang.Object object)
|
java.lang.Object |
clone()
|
abstract java.lang.Object |
doTransform(java.lang.Object src)
|
protected java.lang.String |
generateTransformerName()
|
UMOImmutableEndpoint |
getEndpoint()
|
java.lang.Class |
getFinalReturnClass()
Will return the return type for the last transformer in the chain |
java.lang.String |
getName()
|
java.lang.Class |
getReturnClass()
|
protected java.util.Iterator |
getSourceTypeClassesIterator()
|
UMOTransformer |
getTransformer()
|
void |
initialise()
Template method were deriving classes can do any initialisation after the properties have been set on this transformer |
boolean |
isSourceTypeSupported(java.lang.Class aClass)
|
protected void |
registerSourceType(java.lang.Class aClass)
|
void |
setEndpoint(UMOImmutableEndpoint endpoint)
|
void |
setName(java.lang.String string)
|
void |
setReturnClass(java.lang.Class newClass)
Sets the expected return type for the transformed data. |
void |
setSourceType(java.lang.String type)
Convenience method to register source types using a bean property setter |
void |
setTransformer(UMOTransformer transformer)
|
java.lang.String |
toString()
|
java.lang.Object |
transform(java.lang.Object src)
Transforms the object. |
protected void |
unregisterSourceType(java.lang.Class aClass)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String TRANSFORMER_DEFAULT
Transformer
implementation class to use, if no other can be found.
protected transient Log logger
protected java.lang.Class returnClass
protected java.lang.String name
protected UMOImmutableEndpoint endpoint
protected UMOTransformer transformer
Constructor Detail |
public AbstractTransformer()
Method Detail |
protected java.lang.Object checkReturnClass(java.lang.Object object) throws TransformerException
TransformerException
protected void registerSourceType(java.lang.Class aClass)
protected void unregisterSourceType(java.lang.Class aClass)
protected java.util.Iterator getSourceTypeClassesIterator()
public java.lang.String getName()
getName
in interface UMOSimpleTransformer
public void setName(java.lang.String string)
setName
in interface UMOSimpleTransformer
string
- public java.lang.Class getReturnClass()
getReturnClass
in interface UMOSimpleTransformer
public void setReturnClass(java.lang.Class newClass)
UMOSimpleTransformer
TransformerException
will be thrown.
setReturnClass
in interface UMOSimpleTransformer
newClass
- the expected return type classpublic boolean isSourceTypeSupported(java.lang.Class aClass)
isSourceTypeSupported
in interface UMOTransformer
public final java.lang.Object transform(java.lang.Object src) throws TransformerException
transform
in interface UMOSimpleTransformer
src
- 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 UMOTransformer
public void setEndpoint(UMOImmutableEndpoint endpoint)
setEndpoint
in interface UMOTransformer
endpoint
- sets the endpoint associated with the transfromerpublic abstract java.lang.Object doTransform(java.lang.Object src) throws TransformerException
TransformerException
public UMOTransformer getTransformer()
getTransformer
in interface UMOTransformer
public void setTransformer(UMOTransformer transformer)
setTransformer
in interface UMOTransformer
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface UMOSimpleTransformer
java.lang.CloneNotSupportedException
public java.lang.Class getFinalReturnClass()
public void initialise() throws InitialisationException
initialise
in interface Initialisable
InitialisationException
protected java.lang.String generateTransformerName()
public void setSourceType(java.lang.String type) throws java.lang.ClassNotFoundException
type
- the fully qualified class name
java.lang.ClassNotFoundException
- is thrown if the class is not on theclasspathpublic java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |