|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ikasan.framework.component.transformation.ExtendedXsltTransformer
public class ExtendedXsltTransformer
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
| 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 |
|---|
public ExtendedXsltTransformer(TransformerFactory transformerFactory,
URI styleSheetUri,
boolean useTranslets,
Map<String,Object> externalDataBeans,
Map<String,String> transformationParameters,
XMLReader xmlReader)
throws TransformerConfigurationException
transformerFactory - - Transformer Factory to usestyleSheetUri - - URI for stylesheet for transformationuseTranslets - - flag controlling whether or not we should compile the stylesheet up frontexternalDataBeans - - map of named beans that are made available to the SLTtransformationParameters - - any parameters used by the stylesheet that do not change on a per invocation
basisxmlReader - - used for reading source on transformation
TransformerConfigurationException - - Exception if the transformation fails badly
public ExtendedXsltTransformer(TransformerFactory transformerFactory,
URI styleSheetUri,
boolean useTranslets,
Map<String,Object> externalDataBeans,
Map<String,String> transformationParameters)
throws TransformerConfigurationException
transformerFactory - - Transformer Factory to usestyleSheetUri - - URI for stylesheet for transformationuseTranslets - - flag controlling whether or not we should compile the stylesheet upfrontexternalDataBeans - - map of named beans that are made available to the xslttransformationParameters - - any parameters used by the stylesheet that do not change on a per invocation
basis
TransformerConfigurationException - - Exception if the transformation fails badly| Method Detail |
|---|
public void onEvent(Event event)
throws TransformationException
TransformerEvent
onEvent in interface Transformerevent - Event to transform
TransformationException - Exception if we could not transformprotected void setPayloadParameters(Transformer transformer)
Payload and makes these available to the
transformer
transformer - - Transformer to set the parameters onprotected void addTransformationParameters(Map<String,String> parameters)
parameters - - Parameters to set
protected void transform(Payload payload)
throws TransformerException
payload - The payload to be transformed
TransformerException - if an error occurs while transforming.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||