Spring Integration

org.springframework.integration.xml.selector
Class StringValueTestXPathMessageSelector

java.lang.Object
  extended by org.springframework.integration.xml.selector.AbstractXPathMessageSelector
      extended by org.springframework.integration.xml.selector.StringValueTestXPathMessageSelector
All Implemented Interfaces:
MessageSelector

public class StringValueTestXPathMessageSelector
extends AbstractXPathMessageSelector

XPath MessageSelector that tests if a provided value supports payloads of type Document or String.

Author:
Jonas Partner

Constructor Summary
StringValueTestXPathMessageSelector(java.lang.String expression, java.util.Map<java.lang.String,java.lang.String> namespaces, java.lang.String valueToTestFor)
          Create a selector which tests for the given value and supports multiple namespaces.
StringValueTestXPathMessageSelector(java.lang.String expression, java.lang.String valueToTestFor)
          Creates a non-namespaced testing selector.
StringValueTestXPathMessageSelector(java.lang.String expression, java.lang.String prefix, java.lang.String namespace, java.lang.String valueToTestFor)
          Creates a single namespace Xpath selector.
StringValueTestXPathMessageSelector(org.springframework.xml.xpath.XPathExpression expression, java.lang.String valueToTestFor)
          Creates a selector with the provided XPathExpression.
 
Method Summary
 boolean accept(Message<?> message)
          Evaluate the payload and return true if the value returned by the XPathExpression is equal to the valueToTestFor.
 void setCaseSensitive(boolean caseSensitive)
          Specify whether comparison of value returned by XPathExpression to test value should be case sensitive.
 
Methods inherited from class org.springframework.integration.xml.selector.AbstractXPathMessageSelector
getConverter, getXPathExpresion, setConverter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringValueTestXPathMessageSelector

public StringValueTestXPathMessageSelector(java.lang.String expression,
                                           java.util.Map<java.lang.String,java.lang.String> namespaces,
                                           java.lang.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(java.lang.String expression,
                                           java.lang.String prefix,
                                           java.lang.String namespace,
                                           java.lang.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(java.lang.String expression,
                                           java.lang.String valueToTestFor)
Creates a non-namespaced testing selector.

Parameters:
expression - XPath expression as a String
valueToTestFor - value to test for

StringValueTestXPathMessageSelector

public StringValueTestXPathMessageSelector(org.springframework.xml.xpath.XPathExpression expression,
                                           java.lang.String valueToTestFor)
Creates a selector with the provided XPathExpression.

Parameters:
expression - XPath expression
valueToTestFor - value to test for
Method Detail

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 -

accept

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


Spring Integration