Class BooleanTestXPathMessageSelector

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

public class BooleanTestXPathMessageSelector extends AbstractXPathMessageSelector
Boolean XPath testing MessageSelector. Requires an XPathExpression which can be evaluated using XPathExpression.evaluateAsBoolean(Node). Supports payloads of type Document or String.
  • Constructor Details

    • BooleanTestXPathMessageSelector

      public BooleanTestXPathMessageSelector(String expression, Map<String,String> namespaces)
      Create a boolean testing XPath MessageSelector supporting multiple namespaces.
      Parameters:
      expression - XPath expression as a String
      namespaces - Map of namespaces where the keys are namespace prefixes
    • BooleanTestXPathMessageSelector

      public BooleanTestXPathMessageSelector(String expression, String prefix, String namespace)
      Create a boolean testing XPath MessageSelector supporting a single namespace.
      Parameters:
      expression - XPath expression as a String
      prefix - namespace prefix
      namespace - namespace URI
    • BooleanTestXPathMessageSelector

      public BooleanTestXPathMessageSelector(String expression)
      Create a boolean testing XPath MessageSelector with no namespace support.
      Parameters:
      expression - XPath expression as a String
    • BooleanTestXPathMessageSelector

      public BooleanTestXPathMessageSelector(org.springframework.xml.xpath.XPathExpression expression)
      Create a boolean testing XPath MessageSelector using the provided XPathExpression.
      Parameters:
      expression - XPath expression
  • Method Details

    • accept

      public boolean accept(org.springframework.messaging.Message<?> message)
      Return true if the XPathExpression evaluates to true