org.mule.extras.groovy.transformers
Class GroovyTransformer
java.lang.Object
org.mule.transformers.AbstractTransformer
org.mule.extras.groovy.transformers.GroovyTransformer
- All Implemented Interfaces:
- java.lang.Cloneable, Initialisable, java.io.Serializable, UMOSimpleTransformer, UMOTransformer
- public class GroovyTransformer
- extends AbstractTransformer
GroovyTransformer
a classloader for groovy scripts.
The loader uses the logical name of the transformer as defined in the mule configuration to
locate a corresponding script in a scripts directory i.e. if the Transformer name is foo then
the classloader will attempt to load foo.groovy from the scripts directory.
Thus it is possible to have multiple transformer instances of the class GroovyTransformer
each with a unique name, indicating the appropriate script
The groovy script (class) must have a transform method returning the appropriate type
after it has transformed the supplied source
- Version:
- $Revision: 1.3 $
- Author:
- Ian de Beer, Ross Mason
- See Also:
- Serialized Form
Field Summary |
protected Log |
logger
|
Methods inherited from class org.mule.transformers.AbstractTransformer |
checkReturnClass, generateTransformerName, getEndpoint, getFinalReturnClass, getName, getReturnClass, getSourceTypeClassesIterator, getTransformer, isSourceTypeSupported, registerSourceType, setEndpoint, setName, setReturnClass, setSourceType, setTransformer, toString, transform, unregisterSourceType |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
logger
protected final Log logger
GroovyTransformer
public GroovyTransformer()
doTransform
public java.lang.Object doTransform(java.lang.Object src)
throws TransformerException
- Specified by:
doTransform
in class AbstractTransformer
- Throws:
TransformerException
initialise
public void initialise()
throws InitialisationException
- Description copied from class:
AbstractTransformer
- Template method were deriving classes can do any initialisation
after the properties have been set on this transformer
- Specified by:
initialise
in interface Initialisable
- Overrides:
initialise
in class AbstractTransformer
- Throws:
InitialisationException
setScript
public void setScript(java.lang.String script)
getScript
public java.lang.String getScript()
setScriptLocation
protected void setScriptLocation(java.net.URL scriptLocation)
setGroovyTransformer
protected void setGroovyTransformer(GroovyObject trans)
getMethodName
public java.lang.String getMethodName()
setMethodName
public void setMethodName(java.lang.String methodName)
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface UMOSimpleTransformer
- Overrides:
clone
in class AbstractTransformer
- Throws:
java.lang.CloneNotSupportedException
Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.