Class StringValueTestXPathMessageSelector

java.lang.Object
org.springframework.integration.xml.selector.AbstractXPathMessageSelector
org.springframework.integration.xml.selector.StringValueTestXPathMessageSelector
All Implemented Interfaces:
GenericSelector<Message<?>>, MessageSelector

public class StringValueTestXPathMessageSelector
extends AbstractXPathMessageSelector
XPath MessageSelector that tests if a provided value supports payloads of type Document or String.
Author:
Jonas Partner, Gary Russell
  • Constructor Details

    • StringValueTestXPathMessageSelector

      public StringValueTestXPathMessageSelector​(String expression, Map<String,​String> namespaces, String valueToTestFor)
      Create a selector which tests for the given value and supports multiple namespaces.
      Parameters:
      expression - XPath expression as a String
      namespaces - Map of namespaces where the keys are namespace prefixes
      valueToTestFor - value to test for
    • StringValueTestXPathMessageSelector

      public StringValueTestXPathMessageSelector​(String expression, String prefix, String namespace, String valueToTestFor)
      Creates a single namespace Xpath selector.
      Parameters:
      expression - XPath expression as a String
      prefix - namespace prefix
      namespace - namespace URI
      valueToTestFor - value to test for
    • StringValueTestXPathMessageSelector

      public StringValueTestXPathMessageSelector​(String expression, String valueToTestFor)
      Creates a non-namespaced testing selector.
      Parameters:
      expression - XPath expression as a String
      valueToTestFor - value to test for
    • StringValueTestXPathMessageSelector

      public StringValueTestXPathMessageSelector​(XPathExpression expression, String valueToTestFor)
      Creates a selector with the provided XPathExpression.
      Parameters:
      expression - XPath expression
      valueToTestFor - value to test for
  • Method Details

    • setCaseSensitive

      public void setCaseSensitive​(boolean caseSensitive)
      Specify whether comparison of value returned by XPathExpression to test value should be case sensitive. Default is 'true'.
      Parameters:
      caseSensitive - true if the test should be case sensitive.
    • accept

      public boolean accept​(Message<?> message)
      Evaluate the payload and return true if the value returned by the XPathExpression is equal to the valueToTestFor.