|
|||||||||||
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 static int |
DEFAULT_TRUNCATE_LENGTH
|
protected UMOImmutableEndpoint |
endpoint
The endpoint that this transformer instance is configured on |
protected Log |
logger
logger used by this class |
protected String |
name
The name that identifies this transformer. |
protected UMOTransformer |
nextTransformer
This is the following transformer in the chain of transformers. |
protected Class |
returnClass
The return type that will be returned by the transform(java.lang.Object) method is
called |
protected List |
sourceTypes
A list of supported Class types that the source payload passed into this transformer |
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()
The endpoint that this transformer is attached to |
Class |
getFinalReturnClass()
Will return the return type for the last transformer in the chain |
String |
getName()
|
UMOTransformer |
getNextTransformer()
Transformers can be chained together and invoked in a series |
Class |
getReturnClass()
|
void |
initialise()
Template method were deriving classes can do any initialisation after the properties have been set on this transformer |
boolean |
isAcceptNull()
Does this transformer allow null input? |
boolean |
isIgnoreBadInput()
|
boolean |
isSourceTypeSupported(Class aClass)
Determines if a particular source class can be handled by this transformer |
boolean |
isSourceTypeSupported(Class aClass,
boolean exactMatch)
|
protected Object |
nextTransform(Object result)
Safely call the next transformer in chain, if any. |
protected void |
registerSourceType(Class aClass)
|
void |
setEndpoint(UMOImmutableEndpoint endpoint)
Sets the endpoint associated with with this connector |
void |
setIgnoreBadInput(boolean ignoreBadInput)
|
void |
setName(String string)
|
void |
setNextTransformer(UMOTransformer nextTransformer)
Transformers can be chained together and invoked in a series |
void |
setReturnClass(Class newClass)
Sets the expected return type for the transformed data. |
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 |
protected static final int DEFAULT_TRUNCATE_LENGTH
protected final Log logger
protected Class returnClass
transform(java.lang.Object)
method is
called
protected String name
protected UMOImmutableEndpoint endpoint
protected final List sourceTypes
protected UMOTransformer nextTransformer
Constructor Detail |
public AbstractTransformer()
Method Detail |
protected Object checkReturnClass(Object object) throws TransformerException
TransformerException
protected void registerSourceType(Class aClass)
protected void unregisterSourceType(Class aClass)
public String getName()
getName
in interface UMOBaseTransformer
public void setName(String string)
setName
in interface UMOBaseTransformer
string
- public Class getReturnClass()
getReturnClass
in interface UMOTransformer
public void setReturnClass(Class newClass)
UMOTransformer
TransformerException
will be
thrown.
setReturnClass
in interface UMOTransformer
newClass
- the expected return type classpublic boolean isSourceTypeSupported(Class aClass)
UMOTransformer
isSourceTypeSupported
in interface UMOTransformer
aClass
- The class to check for compatability
public boolean isSourceTypeSupported(Class aClass, boolean exactMatch)
public final Object transform(Object src) throws TransformerException
transform
in interface UMOTransformer
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()
UMOBaseTransformer
getEndpoint
in interface UMOBaseTransformer
public void setEndpoint(UMOImmutableEndpoint endpoint)
UMOBaseTransformer
setEndpoint
in interface UMOBaseTransformer
endpoint
- sets the endpoint associated with the transfromerprotected abstract Object doTransform(Object src, String encoding) throws TransformerException
TransformerException
public UMOTransformer getNextTransformer()
UMOTransformer
getNextTransformer
in interface UMOTransformer
public void setNextTransformer(UMOTransformer nextTransformer)
UMOTransformer
setNextTransformer
in interface UMOTransformer
nextTransformer
- the next transforer to invokepublic Object clone() throws CloneNotSupportedException
clone
in interface UMOBaseTransformer
CloneNotSupportedException
public Class getFinalReturnClass()
public void initialise() throws InitialisationException
initialise
in interface Initialisable
InitialisationException
protected String generateTransformerName()
public boolean isIgnoreBadInput()
public void setIgnoreBadInput(boolean ignoreBadInput)
public String toString()
public boolean isAcceptNull()
UMOTransformer
isAcceptNull
in interface UMOTransformer
protected Object nextTransform(Object result) throws TransformerException
TransformerException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |