1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.config.converters; |
8 | |
|
9 | |
import org.mule.api.MuleContext; |
10 | |
import org.mule.api.expression.PropertyConverter; |
11 | |
import org.mule.api.routing.filter.Filter; |
12 | |
import org.mule.expression.ExpressionConfig; |
13 | |
import org.mule.routing.filters.ExpressionFilter; |
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | 0 | public class FilterConverter implements PropertyConverter |
20 | |
{ |
21 | |
public Object convert(String property, MuleContext context) |
22 | |
{ |
23 | 0 | if (null != property) |
24 | |
{ |
25 | 0 | ExpressionConfig config = new ExpressionConfig(); |
26 | 0 | config.parse(property); |
27 | 0 | ExpressionFilter filter = new ExpressionFilter(config.getExpression(), config.getEvaluator(), config.getCustomEvaluator()); |
28 | 0 | filter.setMuleContext(context); |
29 | 0 | return filter; |
30 | |
} |
31 | |
else |
32 | |
{ |
33 | 0 | return null; |
34 | |
} |
35 | |
|
36 | |
} |
37 | |
|
38 | |
public Class getType() |
39 | |
{ |
40 | 0 | return Filter.class; |
41 | |
} |
42 | |
} |