public class BooleanTestXPathMessageSelector extends AbstractXPathMessageSelector
MessageSelector
. Requires an XPathExpression
which can be evaluated using XPathExpression.evaluateAsBoolean(Node)
.
Supports payloads of type Document
or String
.Constructor and Description |
---|
BooleanTestXPathMessageSelector(java.lang.String expression)
Create a boolean testing XPath
MessageSelector with no namespace support. |
BooleanTestXPathMessageSelector(java.lang.String expression,
java.util.Map<java.lang.String,java.lang.String> namespaces)
Create a boolean testing XPath
MessageSelector supporting
multiple namespaces. |
BooleanTestXPathMessageSelector(java.lang.String expression,
java.lang.String prefix,
java.lang.String namespace)
Create a boolean testing XPath
MessageSelector supporting a single namespace. |
BooleanTestXPathMessageSelector(org.springframework.xml.xpath.XPathExpression expression)
Create a boolean testing XPath
MessageSelector using the
provided XPathExpression . |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Message<?> message)
Return true if the
XPathExpression evaluates to true |
getConverter, getXPathExpresion, setConverter
public BooleanTestXPathMessageSelector(java.lang.String expression, java.util.Map<java.lang.String,java.lang.String> namespaces)
MessageSelector
supporting
multiple namespaces.expression
- XPath expression as a Stringnamespaces
- Map of namespaces where the keys are namespace prefixespublic BooleanTestXPathMessageSelector(java.lang.String expression, java.lang.String prefix, java.lang.String namespace)
MessageSelector
supporting a single namespace.expression
- XPath expression as a Stringprefix
- namespace prefixnamespace
- namespace URIpublic BooleanTestXPathMessageSelector(java.lang.String expression)
MessageSelector
with no namespace support.expression
- XPath expression as a Stringpublic BooleanTestXPathMessageSelector(org.springframework.xml.xpath.XPathExpression expression)
MessageSelector
using the
provided XPathExpression
.expression
- XPath expressionpublic boolean accept(Message<?> message)
XPathExpression
evaluates to true