|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.transformer.AbstractTransformer org.springframework.integration.xml.transformer.XsltPayloadTransformer
public class XsltPayloadTransformer
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.
Constructor Summary | |
---|---|
XsltPayloadTransformer(Resource xslResource)
|
|
XsltPayloadTransformer(Resource xslResource,
ResultTransformer resultTransformer)
|
|
XsltPayloadTransformer(Templates templates)
|
|
XsltPayloadTransformer(Templates templates,
ResultTransformer resultTransformer)
|
Method Summary | |
---|---|
protected Transformer |
buildTransformer(Message<?> message)
|
protected Object |
doTransform(Message<?> message)
Subclasses must implement this method to provide the transformation logic. |
void |
setAlwaysUseSourceResultFactories(boolean alwaysUserSourceResultFactories)
Specifies whether ResultFactory and SourceFactory should always
be used, even for directly supported payloads such as String and Document . |
void |
setResultFactory(ResultFactory resultFactory)
Sets the ResultFactory |
void |
setSourceFactory(SourceFactory sourceFactory)
Sets the SourceFactory. |
protected Document |
transformDocument(Document documentPayload,
Transformer transformer)
|
protected Object |
transformSource(Source source,
Object payload,
Transformer transformer)
|
protected String |
transformString(String stringPayload,
Transformer transformer)
|
protected Object |
transformUsingFactories(Object payload,
Transformer transformer)
|
Methods inherited from class org.springframework.integration.transformer.AbstractTransformer |
---|
transform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XsltPayloadTransformer(Templates templates) throws ParserConfigurationException
ParserConfigurationException
public XsltPayloadTransformer(Templates templates, ResultTransformer resultTransformer) throws ParserConfigurationException
ParserConfigurationException
public XsltPayloadTransformer(Resource xslResource) throws Exception
Exception
public XsltPayloadTransformer(Resource xslResource, ResultTransformer resultTransformer) throws Exception
Exception
Method Detail |
---|
public void setSourceFactory(SourceFactory sourceFactory)
public void setResultFactory(ResultFactory resultFactory)
public void setAlwaysUseSourceResultFactories(boolean alwaysUserSourceResultFactories)
ResultFactory
and SourceFactory
should always
be used, even for directly supported payloads such as String
and Document
.
protected Object doTransform(Message<?> message) throws Exception
AbstractTransformer
doTransform
in class AbstractTransformer
Exception
protected Object transformUsingFactories(Object payload, Transformer transformer) throws TransformerException
TransformerException
protected Object transformSource(Source source, Object payload, Transformer transformer) throws TransformerException
TransformerException
protected String transformString(String stringPayload, Transformer transformer) throws TransformerException
TransformerException
protected Document transformDocument(Document documentPayload, Transformer transformer) throws TransformerException
TransformerException
protected Transformer buildTransformer(Message<?> message) throws TransformerException
TransformerException
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |