Class RegexTestXPathMessageSelector
java.lang.Object
org.springframework.integration.xml.selector.AbstractXPathMessageSelector
org.springframework.integration.xml.selector.RegexTestXPathMessageSelector
- All Implemented Interfaces:
GenericSelector<Message<?>>,MessageSelector
public class RegexTestXPathMessageSelector extends AbstractXPathMessageSelector
XPath
MessageSelector that tests if a
provided String value matches a given Regular Expression.- Since:
- 2.1
- Author:
- Mark Fisher, Gary Russell
-
Constructor Summary
Constructors Constructor Description RegexTestXPathMessageSelector(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.RegexTestXPathMessageSelector(String expression, Map<String,String> namespaces, String regex)Creates a selector which attempts to match the given regex and supports multiple namespaces.RegexTestXPathMessageSelector(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 Type Method Description booleanaccept(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
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
Evaluate the payload and return true if the value returned by theXPathExpressionmatches theregex.
-