|
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.XPathTransformer
public class XPathTransformer
Transformer implementation that evaluates an XPath expression against the inbound
Message payload and returns a Message whose payload is the result of that evaluation.
Prior to evaluation, the payload may be converted by the configured XmlPayloadConverter
instance. The default converter type is DefaultXmlPayloadConverter
.
The evaluation result type will depend on either the enumeration value provided to
setEvaluationType(XPathEvaluationType)
or the presence of a NodeMapper
,
which takes precedence. If no NodeMapper
or evaluation type is configured explicitly,
the default evaluation type is XPathEvaluationType.STRING_RESULT
.
Constructor Summary | |
---|---|
XPathTransformer(String expression)
Create an XPathTransformer that will create an XPath expression from the given String
to be evaluated against converted inbound Message payloads. |
|
XPathTransformer(org.springframework.xml.xpath.XPathExpression expression)
Create an XPathTransformer that will evaluate the given XPathExpression
against converted inbound Message payloads. |
Method Summary | |
---|---|
protected Object |
doTransform(Message<?> message)
Subclasses must implement this method to provide the transformation logic. |
void |
setConverter(XmlPayloadConverter converter)
Specify the XmlPayloadConverter to use when converting a Message payload prior to XPath evaluation. |
void |
setEvaluationType(XPathEvaluationType evaluationType)
Specify the expected XPathEvaluationType . |
void |
setNodeMapper(org.springframework.xml.xpath.NodeMapper nodeMapper)
Set a NodeMapper to use for generating the result object. |
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 XPathTransformer(String expression)
XPathTransformer
that will create an XPath expression from the given String
to be evaluated against converted inbound Message payloads.
public XPathTransformer(org.springframework.xml.xpath.XPathExpression expression)
XPathTransformer
that will evaluate the given XPathExpression
against converted inbound Message payloads.
Method Detail |
---|
public void setEvaluationType(XPathEvaluationType evaluationType)
XPathEvaluationType
. The default is XPathEvaluationType.STRING_RESULT
.
public void setNodeMapper(org.springframework.xml.xpath.NodeMapper nodeMapper)
NodeMapper
to use for generating the result object. By default the NodeMapper is null,
but if explicitly set, type determination is the responsibility of the NodeMapper, taking precedence
over any configured evaluationType.
public void setConverter(XmlPayloadConverter converter)
XmlPayloadConverter
to use when converting a Message payload prior to XPath evaluation.
protected Object doTransform(Message<?> message) throws Exception
AbstractTransformer
doTransform
in class AbstractTransformer
Exception
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |