public class XsltPayloadTransformer extends AbstractXmlTransformer implements BeanClassLoaderAware
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.
DOM_RESULT, STRING_RESULT
EXPRESSION_PARSER, logger
Constructor and Description |
---|
XsltPayloadTransformer(Resource xslResource) |
XsltPayloadTransformer(Resource xslResource,
ResultTransformer resultTransformer) |
XsltPayloadTransformer(Resource xslResource,
ResultTransformer resultTransformer,
String transformerFactoryClassName) |
XsltPayloadTransformer(Resource xslResource,
String transformerFactoryClassName) |
XsltPayloadTransformer(Templates templates) |
XsltPayloadTransformer(Templates templates,
ResultTransformer resultTransformer) |
Modifier and Type | Method and Description |
---|---|
protected Object |
doTransform(Message<?> message)
Subclasses must implement this method to provide the transformation
logic.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setAlwaysUseResultFactory(boolean alwaysUseResultFactory)
Specify whether to always use result factory even for directly supported payload types
|
void |
setAlwaysUseSourceFactory(boolean alwaysUseSourceFactory)
Specify whether to always use source factory even for directly supported payload types.
|
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setResultFactory(ResultFactory resultFactory)
Sets the ResultFactory.
|
void |
setResultFactoryName(String resultFactoryName) |
void |
setResultType(String resultType) |
void |
setSourceFactory(SourceFactory sourceFactory)
Sets the SourceFactory.
|
void |
setXslParameterMappings(Map<String,Expression> xslParameterMappings) |
void |
setXsltParamHeaders(String... xsltParamHeaders) |
getResultFactory, getResultFactoryName, getResultType
transform
afterPropertiesSet, 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
public XsltPayloadTransformer(Templates templates)
public XsltPayloadTransformer(Templates templates, ResultTransformer resultTransformer)
public XsltPayloadTransformer(Resource xslResource)
public XsltPayloadTransformer(Resource xslResource, ResultTransformer resultTransformer)
public XsltPayloadTransformer(Resource xslResource, String transformerFactoryClassName)
public XsltPayloadTransformer(Resource xslResource, ResultTransformer resultTransformer, String transformerFactoryClassName)
public void setSourceFactory(SourceFactory sourceFactory)
sourceFactory
- The source factory.public void setResultFactory(ResultFactory resultFactory)
setResultFactory
in class AbstractXmlTransformer
resultFactory
- The result factory.public void setAlwaysUseSourceFactory(boolean alwaysUseSourceFactory)
alwaysUseSourceFactory
- true to always use the source factory.public void setAlwaysUseResultFactory(boolean alwaysUseResultFactory)
alwaysUseResultFactory
- true to always use the result factory.public void setXslParameterMappings(Map<String,Expression> xslParameterMappings)
public void setXsltParamHeaders(String... xsltParamHeaders)
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public void setResultType(String resultType)
setResultType
in class AbstractXmlTransformer
public void setResultFactoryName(String resultFactoryName)
setResultFactoryName
in class AbstractXmlTransformer
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected void onInit()
IntegrationObjectSupport
onInit
in class AbstractXmlTransformer
protected Object doTransform(Message<?> message)
AbstractTransformer
doTransform
in class AbstractTransformer
message
- The message.