Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.routing.filters
Class ExpressionFilter

    java.lang.Object
      org.mule.routing.filters.ExpressionFilter

All Implemented Interfaces:
  MuleContextAware, Filter

Direct Known Subclasses:
  ErrorExpressionFilter

    public class ExpressionFilter

extends Object
implements Filter, MuleContextAware

Allows boolean expressions to be executed on a message. Note that when using this filter you must be able to either specify a boolean expression when using an expression filter or use one of the standard Mule filters. These can be defined as follows -

- RegEx - 'regex:': #[regex:'error' [0-9]]
- Wildcard - 'wildcard:': #[wildcard: *foo*
- PayloadType - 'payload-type:': #[payload:javax.jms.TextMessage]
- ExceptionType - 'exception-type:': #[exception-type:java.io.FileNotFoundException]
- Header - 'header:': #[header:foo!=null]

Otherwise you can use eny expression filter providing you can define a boolean expression i.e. `#[xpath:count(/Foo/Bar) == 0]` Note that it if the expression is not a boolean expression this filter will return true if the expression returns a result

Field Summary
`protected Log` | `logger` logger used by this class

Constructor Summary
`ExpressionFilter()`
`ExpressionFilter(String expression)`
`ExpressionFilter(String evaluator, String expression)`
`ExpressionFilter(String evaluator, String customEvaluator, String expression)`

Method Summary
`boolean` | `accept(MuleMessage message)` Check a given message against this filter.
`boolean` | `equals(Object obj)`
`String` | `getCustomEvaluator()`
`String` | `getEvaluator()`
`String` | `getExpression()`
`protected String` | `getFullExpression()`
`int` | `hashCode()`
`boolean` | `isNullReturnsTrue()`
`void` | `setCustomEvaluator(String customEvaluator)`
`void` | `setEvaluator(String evaluator)`
`void` | `setExpression(String expression)`
`void` | `setMuleContext(MuleContext context)`
`void` | `setNullReturnsTrue(boolean nullReturnsTrue)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### logger

    protected final transient Log logger

  logger used by this class

Constructor Detail

### ExpressionFilter

    public ExpressionFilter(String evaluator,
                            String customEvaluator,
                            String expression)

### ExpressionFilter

    public ExpressionFilter(String evaluator,
                            String expression)

### ExpressionFilter

    public ExpressionFilter(String expression)

### ExpressionFilter

    public ExpressionFilter()

Method Detail

### setMuleContext

    public void setMuleContext(MuleContext context)

  Specified by:
    `setMuleContext` in interface `MuleContextAware`

### accept

    public boolean accept(MuleMessage message)

  Check a given message against this filter.

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

### getFullExpression

    protected String getFullExpression()

### getCustomEvaluator

    public String getCustomEvaluator()

### setCustomEvaluator

    public void setCustomEvaluator(String customEvaluator)

### getEvaluator

    public String getEvaluator()

### setEvaluator

    public void setEvaluator(String evaluator)

### getExpression

    public String getExpression()

### setExpression

    public void setExpression(String expression)

### isNullReturnsTrue

    public boolean isNullReturnsTrue()

### setNullReturnsTrue

    public void setNullReturnsTrue(boolean nullReturnsTrue)

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.