public class XsltPayloadTransformer extends AbstractTransformer 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.
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 |
setSourceFactory(SourceFactory sourceFactory)
Sets the SourceFactory.
|
void |
setXslParameterMappings(Map<String,Expression> xslParameterMappings) |
void |
setXsltParamHeaders(String[] xsltParamHeaders) |
transform
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
public XsltPayloadTransformer(Templates templates)
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 XsltPayloadTransformer(Templates templates, ResultTransformer resultTransformer)
public void setSourceFactory(SourceFactory sourceFactory)
sourceFactory
- The source factory.public void setResultFactory(ResultFactory resultFactory)
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 String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected void onInit() throws Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
Exception
- Any exception.protected Object doTransform(Message<?> message) throws Exception
AbstractTransformer
doTransform
in class AbstractTransformer
message
- The message.Exception
- Any exception.