org.ikasan.framework.component.transformation
Class ExtendedXsltTransformer

java.lang.Object
  extended by org.ikasan.framework.component.transformation.ExtendedXsltTransformer
All Implemented Interfaces:
Transformer, FlowComponent

Deprecated. - Use XslTransformer which supports the stylesheet being specified through an InputStream rather than a URI.

public class ExtendedXsltTransformer
extends Object
implements Transformer

This class is an XSLT Transformer component that acts on all an Event's Payloads, transforming them using the supplied style sheet. This implementation is notable for the following reasons: 1) It is intended to be threadsafe with respect to the underlying javax.xml.transform.Transformer as a new instance is created every time the business method (onEvent) is called. Each instance of this class will associate to one and only one style sheet during its life, and as such instances will be good for only one type of transformation only. 2) Is is intended to be capable of transforming non-xml Payloads through the configuration of a content specific XMLReader. E.g. an XMLReader implementation capable of reading fixed length flat files can be injected on construction thus allowing flat file (fixed length) payloads to be directly transformed with XSLT 3) It is designed to allow a set of externally sourced (injected) java beans to be supplied scoped to the underlying transformer. This allows for such function as database calls from the XSLT to be supported indirectly through the injection of externally managed supporting beans 4) Rather than relying on the default ErrorListener this transformer supplies its own implementation designed to propagate the exceptions thrown for parse time errors and warnings

Author:
Ikasan Development Team

Constructor Summary
ExtendedXsltTransformer(TransformerFactory transformerFactory, URI styleSheetUri, boolean useTranslets, Map<String,Object> externalDataBeans, Map<String,String> transformationParameters)
          Deprecated. Constructor
ExtendedXsltTransformer(TransformerFactory transformerFactory, URI styleSheetUri, boolean useTranslets, Map<String,Object> externalDataBeans, Map<String,String> transformationParameters, XMLReader xmlReader)
          Deprecated. Constructor
 
Method Summary
protected  void addTransformationParameters(Map<String,String> parameters)
          Deprecated. Adds a map of parameters to the list of parameters already set, typically used by children of this class.
 void onEvent(Event event)
          Deprecated. Transforms or otherwise changes the passed in Event
protected  void setPayloadParameters(Transformer transformer)
          Deprecated. Creates a parameter list of known fields derived from the Payload and makes these available to the transformer
protected  void transform(Payload payload)
          Deprecated. Transforms the payload content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedXsltTransformer

public ExtendedXsltTransformer(TransformerFactory transformerFactory,
                               URI styleSheetUri,
                               boolean useTranslets,
                               Map<String,Object> externalDataBeans,
                               Map<String,String> transformationParameters,
                               XMLReader xmlReader)
                        throws TransformerConfigurationException
Deprecated. 
Constructor

Parameters:
transformerFactory - - Transformer Factory to use
styleSheetUri - - URI for stylesheet for transformation
useTranslets - - flag controlling whether or not we should compile the stylesheet up front
externalDataBeans - - map of named beans that are made available to the SLT
transformationParameters - - any parameters used by the stylesheet that do not change on a per invocation basis
xmlReader - - used for reading source on transformation
Throws:
TransformerConfigurationException - - Exception if the transformation fails badly

ExtendedXsltTransformer

public ExtendedXsltTransformer(TransformerFactory transformerFactory,
                               URI styleSheetUri,
                               boolean useTranslets,
                               Map<String,Object> externalDataBeans,
                               Map<String,String> transformationParameters)
                        throws TransformerConfigurationException
Deprecated. 
Constructor

Parameters:
transformerFactory - - Transformer Factory to use
styleSheetUri - - URI for stylesheet for transformation
useTranslets - - flag controlling whether or not we should compile the stylesheet upfront
externalDataBeans - - map of named beans that are made available to the xslt
transformationParameters - - any parameters used by the stylesheet that do not change on a per invocation basis
Throws:
TransformerConfigurationException - - Exception if the transformation fails badly
Method Detail

onEvent

public void onEvent(Event event)
             throws TransformationException
Deprecated. 
Description copied from interface: Transformer
Transforms or otherwise changes the passed in Event

Specified by:
onEvent in interface Transformer
Parameters:
event - Event to transform
Throws:
TransformationException - Exception if we could not transform

setPayloadParameters

protected void setPayloadParameters(Transformer transformer)
Deprecated. 
Creates a parameter list of known fields derived from the Payload and makes these available to the transformer

Parameters:
transformer - - Transformer to set the parameters on

addTransformationParameters

protected void addTransformationParameters(Map<String,String> parameters)
Deprecated. 
Adds a map of parameters to the list of parameters already set, typically used by children of this class.

Parameters:
parameters - - Parameters to set

transform

protected void transform(Payload payload)
                  throws TransformerException
Deprecated. 
Transforms the payload content.

Parameters:
payload - The payload to be transformed
Throws:
TransformerException - if an error occurs while transforming.


Copyright © 2007-2012 Ikasan. All Rights Reserved.