org.mule.routing.filters.xml
Class JXPathFilter

java.lang.Object
  extended by org.mule.routing.filters.xml.JXPathFilter
All Implemented Interfaces:
UMOFilter
Direct Known Subclasses:
JXPathMessageFilter

public class JXPathFilter
extends Object
implements UMOFilter

JXPathFilter evaluates an XPath expression against a W3C Document, XML string, or Java bean and returns true if the result is as expected.


Field Summary
protected  Log logger
           
 
Constructor Summary
JXPathFilter()
           
JXPathFilter(String expression)
           
JXPathFilter(String expression, String expectedValue)
           
 
Method Summary
 boolean accept(UMOMessage obj)
          Check a given message against this filter.
 Map getContextProperties()
           
 String getExpectedValue()
           
 String getExpression()
           
 org.apache.commons.jxpath.AbstractFactory getFactory()
           
 Map getNamespaces()
           
 String getValue()
          Deprecated. Use getExpectedValue().
protected  void initialise(org.apache.commons.jxpath.JXPathContext context)
          Initializes the JXPathContext based on any relevant properties set for the filter.
 boolean isLenient()
           
 void setContextProperties(Map contextProperties)
           
 void setExpectedValue(String expectedValue)
          Sets the expected result value of the XPath expression
 void setExpression(String expression)
           
 void setFactory(org.apache.commons.jxpath.AbstractFactory factory)
           
 void setLenient(boolean lenient)
           
 void setNamespaces(Map namespaces)
           
 void setValue(String value)
          Deprecated. Use setExpectedValue(String expectedValue).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient Log logger
Constructor Detail

JXPathFilter

public JXPathFilter()

JXPathFilter

public JXPathFilter(String expression)

JXPathFilter

public JXPathFilter(String expression,
                    String expectedValue)
Method Detail

accept

public boolean accept(UMOMessage obj)
Description copied from interface: UMOFilter
Check a given message against this filter.

Specified by:
accept in interface UMOFilter
Parameters:
obj - a non null message to filter.
Returns:
true if the message matches the filter

initialise

protected void initialise(org.apache.commons.jxpath.JXPathContext context)
Initializes the JXPathContext based on any relevant properties set for the filter.

Parameters:
the - JXPathContext to initialize

getExpression

public String getExpression()
Returns:
XPath expression

setExpression

public void setExpression(String expression)
Parameters:
expression - The XPath expression

getExpectedValue

public String getExpectedValue()
Returns:
The expected result value of the XPath expression

setExpectedValue

public void setExpectedValue(String expectedValue)
Sets the expected result value of the XPath expression


getValue

public String getValue()
Deprecated. Use getExpectedValue().

Returns:
The expected result value of the XPath expression

setValue

public void setValue(String value)
Deprecated. Use setExpectedValue(String expectedValue).

Sets the expected result value of the XPath expression


getNamespaces

public Map getNamespaces()

setNamespaces

public void setNamespaces(Map namespaces)

getContextProperties

public Map getContextProperties()

setContextProperties

public void setContextProperties(Map contextProperties)

getFactory

public org.apache.commons.jxpath.AbstractFactory getFactory()

setFactory

public void setFactory(org.apache.commons.jxpath.AbstractFactory factory)

isLenient

public boolean isLenient()

setLenient

public void setLenient(boolean lenient)


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.