Class XsltPayloadTransformer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.xml.transformer.AbstractXmlTransformer
org.springframework.integration.xml.transformer.XsltPayloadTransformer
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- ExpressionCapable,- GenericTransformer<Message<?>,,- Message<?>> - NamedComponent,- Transformer
Thread safe XSLT transformer implementation which returns a transformed
 
Source, Document, or String. If
 alwaysUseSourceResultFactories is false (default) the following logic occurs
 
 String payload in results in String payload out
 
 Document payload in results in Document payload out
 
 Source payload in results in Result payload out, type will be
 determined by the ResultFactory,
 DomResultFactory by default.
 If an instance of ResultTransformer is registered this will be used
 to convert the result.
 
 If alwaysUseSourceResultFactories is true then the ResultFactory and
 SourceFactory will be used to create the Source from the
 payload and the Result to pass into the transformer. An instance of
 ResultTransformer can also be provided to convert the Result prior to
 returning.
- Author:
- Jonas Partner, Mark Fisher, Oleg Zhurakousky, Artem Bilan, Mike Bazos, Gary Russell, Trung Pham
- 
Field SummaryFields inherited from class org.springframework.integration.xml.transformer.AbstractXmlTransformerDOM_RESULT, STRING_RESULTFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, logger
- 
Constructor SummaryConstructorsConstructorDescriptionXsltPayloadTransformer(Templates templates) XsltPayloadTransformer(Templates templates, ResultTransformer resultTransformer) XsltPayloadTransformer(Resource xslResource) XsltPayloadTransformer(Resource xslResource, String transformerFactoryClassName) XsltPayloadTransformer(Resource xslResource, ResultTransformer resultTransformer) XsltPayloadTransformer(Resource xslResource, ResultTransformer resultTransformer, String transformerFactoryClassName) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected ObjectdoTransform(Message<?> message) Subclasses must implement this method to provide the transformation logic.Subclasses may implement this method to provide component type information.protected voidonInit()Subclasses may implement this for initialization logic.voidsetAlwaysUseResultFactory(boolean alwaysUseResultFactory) Specify whether to always use result factory even for directly supported payload typesvoidsetAlwaysUseSourceFactory(boolean alwaysUseSourceFactory) Specify whether to always use source factory even for directly supported payload types.voidsetBeanClassLoader(ClassLoader classLoader) voidsetResultFactory(ResultFactory resultFactory) Sets the ResultFactory.voidsetResultFactoryName(String resultFactoryName) voidsetResultType(String resultType) voidsetSourceFactory(SourceFactory sourceFactory) Sets the SourceFactory.voidsetXslParameterMappings(Map<String, Expression> xslParameterMappings) voidsetXsltParamHeaders(String... xsltParamHeaders) Methods inherited from class org.springframework.integration.xml.transformer.AbstractXmlTransformergetResultFactory, getResultFactoryName, getResultTypeMethods inherited from class org.springframework.integration.transformer.AbstractTransformertransformMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
- 
Constructor Details- 
XsltPayloadTransformer
- 
XsltPayloadTransformer
- 
XsltPayloadTransformer
- 
XsltPayloadTransformer
- 
XsltPayloadTransformer
- 
XsltPayloadTransformerpublic XsltPayloadTransformer(Resource xslResource, ResultTransformer resultTransformer, String transformerFactoryClassName) 
 
- 
- 
Method Details- 
setSourceFactorySets the SourceFactory.- Parameters:
- sourceFactory- The source factory.
 
- 
setResultFactorySets the ResultFactory.- Overrides:
- setResultFactoryin class- AbstractXmlTransformer
- Parameters:
- resultFactory- The result factory.
 
- 
setAlwaysUseSourceFactorypublic void setAlwaysUseSourceFactory(boolean alwaysUseSourceFactory) Specify whether to always use source factory even for directly supported payload types.- Parameters:
- alwaysUseSourceFactory- true to always use the source factory.
 
- 
setAlwaysUseResultFactorypublic void setAlwaysUseResultFactory(boolean alwaysUseResultFactory) Specify whether to always use result factory even for directly supported payload types- Parameters:
- alwaysUseResultFactory- true to always use the result factory.
 
- 
setXslParameterMappings
- 
setXsltParamHeaders
- 
setBeanClassLoader- Specified by:
- setBeanClassLoaderin interface- BeanClassLoaderAware
 
- 
setResultType- Overrides:
- setResultTypein class- AbstractXmlTransformer
 
- 
setResultFactoryName- Overrides:
- setResultFactoryNamein class- AbstractXmlTransformer
 
- 
getComponentTypeDescription copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
- getComponentTypein interface- NamedComponent
- Overrides:
- getComponentTypein class- IntegrationObjectSupport
 
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- AbstractXmlTransformer
 
- 
doTransformDescription copied from class:AbstractTransformerSubclasses must implement this method to provide the transformation logic. If the return value is itself a Message, it will be used as the result. Otherwise, any non-null return value will be used as the payload of the result Message.- Specified by:
- doTransformin class- AbstractTransformer
- Parameters:
- message- The message.
- Returns:
- The result of the transformation.
 
 
-