org.mule.transformers.xml
Class XsltTransformer

java.lang.Object
  extended byorg.mule.transformers.AbstractTransformer
      extended byorg.mule.transformers.xml.AbstractXmlTransformer
          extended byorg.mule.transformers.xml.XsltTransformer
All Implemented Interfaces:
Cloneable, Initialisable, UMOBaseTransformer, UMOTransformer

public class XsltTransformer
extends AbstractXmlTransformer

XsltTransformer performs an XSLT transform on a DOM (or other XML-ish) object.


Nested Class Summary
protected  class XsltTransformer.DefaultErrorListener
           
protected  class XsltTransformer.PooledXsltTransformerFactory
           
 
Nested classes inherited from class org.mule.transformers.xml.AbstractXmlTransformer
AbstractXmlTransformer.ResultHolder
 
Field Summary
protected  GenericObjectPool transformerPool
           
 
Fields inherited from class org.mule.transformers.AbstractTransformer
DEFAULT_TRUNCATE_LENGTH, endpoint, logger, name, nextTransformer, returnClass, sourceTypes
 
Constructor Summary
XsltTransformer()
           
 
Method Summary
 Object clone()
           
 Object doTransform(Object src, String encoding)
          Transform, using XSLT, a XML String to another String.
 int getMaxActiveTransformers()
           
 int getMaxIdleTransformers()
           
protected  StreamSource getStreamSource()
          Returns the StreamSource corresponding to xslFile
 String getXslFile()
           
 String getXslt()
           
 String getXslTransformerFactory()
          Returns the name of the currently configured javax.xml.transform.Transformer factory class used to create XSLT Transformers.
 void initialise()
          Template method were deriving classes can do any initialisation after the properties have been set on this transformer
 void setMaxActiveTransformers(int maxActiveTransformers)
          Sets the the current maximum number of idle transformer objects allowed in the pool
 void setMaxIdleTransformers(int maxIdleTransformers)
          Sets the the current maximum number of idle transformer objects allowed in the pool
 void setXslFile(String xslFile)
           
 void setXslt(String xslt)
           
 void setXslTransformerFactory(String xslTransformerFactory)
          Configures the javax.xml.transform.Transformer factory class
 
Methods inherited from class org.mule.transformers.xml.AbstractXmlTransformer
convertToBytes, convertToText, convertToText, getOutputEncoding, getResultHolder, getXmlSource, setOutputEncoding
 
Methods inherited from class org.mule.transformers.AbstractTransformer
checkReturnClass, generateTransformerName, getEndpoint, getFinalReturnClass, getName, getNextTransformer, getReturnClass, isAcceptNull, isIgnoreBadInput, isSourceTypeSupported, isSourceTypeSupported, nextTransform, registerSourceType, setEndpoint, setIgnoreBadInput, setName, setNextTransformer, setReturnClass, toString, transform, unregisterSourceType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transformerPool

protected final GenericObjectPool transformerPool
Constructor Detail

XsltTransformer

public XsltTransformer()
Method Detail

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
See Also:
Initialisable.initialise()

doTransform

public Object doTransform(Object src,
                          String encoding)
                   throws TransformerException
Transform, using XSLT, a XML String to another String.

Specified by:
doTransform in class AbstractTransformer
Parameters:
src - The source XML (String, byte[], DOM, etc.)
Returns:
The result String (or DOM)
Throws:
TransformerException

getXslTransformerFactory

public String getXslTransformerFactory()
Returns the name of the currently configured javax.xml.transform.Transformer factory class used to create XSLT Transformers.

Returns:
a TransformerFactory class name or null if none has been configured

setXslTransformerFactory

public void setXslTransformerFactory(String xslTransformerFactory)
Configures the javax.xml.transform.Transformer factory class

Parameters:
xslTransformerFactory - the name of the TransformerFactory class to use

getXslFile

public String getXslFile()
Returns:
Returns the xslFile.

setXslFile

public void setXslFile(String xslFile)
Parameters:
xslFile - The xslFile to set.

getXslt

public String getXslt()

setXslt

public void setXslt(String xslt)

getStreamSource

protected StreamSource getStreamSource()
                                throws InitialisationException
Returns the StreamSource corresponding to xslFile

Returns:
The StreamSource
Throws:
InitialisationException

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface UMOBaseTransformer
Overrides:
clone in class AbstractTransformer
Throws:
CloneNotSupportedException

getMaxActiveTransformers

public int getMaxActiveTransformers()
Returns:
The current maximum number of allowable idle transformer objects in the pool

setMaxActiveTransformers

public void setMaxActiveTransformers(int maxActiveTransformers)
Sets the the current maximum number of idle transformer objects allowed in the pool


getMaxIdleTransformers

public int getMaxIdleTransformers()
Returns:
The current maximum number of allowable idle transformer objects in the pool

setMaxIdleTransformers

public void setMaxIdleTransformers(int maxIdleTransformers)
Sets the the current maximum number of idle transformer objects allowed in the pool

Parameters:
maxIdleTransformers - New maximum size to set


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.