Class RegexTestXPathMessageSelector
java.lang.Object
org.springframework.integration.xml.selector.AbstractXPathMessageSelector
org.springframework.integration.xml.selector.RegexTestXPathMessageSelector
- All Implemented Interfaces:
org.springframework.integration.core.GenericSelector<org.springframework.messaging.Message<?>>,org.springframework.integration.core.MessageSelector
XPath
MessageSelector that tests if a
provided String value matches a given Regular Expression.- Since:
- 2.1
-
Constructor Summary
ConstructorsConstructorDescriptionRegexTestXPathMessageSelector(String expression, String regex) Creates a non-namespaced selector which attempts to match the given regex.RegexTestXPathMessageSelector(String expression, String prefix, String namespace, String regex) Creates a selector which attempts to match the given regex and supports a single namespace.Creates a selector which attempts to match the given regex and supports multiple namespaces.RegexTestXPathMessageSelector(org.springframework.xml.xpath.XPathExpression expression, String regex) Creates a selector which attempts to match the given regex against the evaluation result of the providedXPathExpression. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(org.springframework.messaging.Message<?> message) Evaluate the payload and return true if the value returned by theXPathExpressionmatches theregex.Methods inherited from class org.springframework.integration.xml.selector.AbstractXPathMessageSelector
getConverter, getXPathExpresion, setConverter
-
Constructor Details
-
RegexTestXPathMessageSelector
public RegexTestXPathMessageSelector(String expression, Map<String, String> namespaces, String regex) Creates a selector which attempts to match the given regex and supports multiple namespaces.- Parameters:
expression- XPath expression as a Stringnamespaces- Map of namespaces where the keys are namespace prefixesregex- regular expression to match
-
RegexTestXPathMessageSelector
public RegexTestXPathMessageSelector(String expression, String prefix, String namespace, String regex) Creates a selector which attempts to match the given regex and supports a single namespace.- Parameters:
expression- XPath expression as a Stringprefix- namespace prefixnamespace- namespace URIregex- regular expression to match
-
RegexTestXPathMessageSelector
Creates a non-namespaced selector which attempts to match the given regex.- Parameters:
expression- XPath expression as a Stringregex- regular expression to match
-
RegexTestXPathMessageSelector
public RegexTestXPathMessageSelector(org.springframework.xml.xpath.XPathExpression expression, String regex) Creates a selector which attempts to match the given regex against the evaluation result of the providedXPathExpression.- Parameters:
expression- XPath expressionregex- regular expression to match
-
-
Method Details
-
accept
public boolean accept(org.springframework.messaging.Message<?> message) Evaluate the payload and return true if the value returned by theXPathExpressionmatches theregex.
-