1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.mule.module.xml.expression; |
11 | |
|
12 | |
import org.jaxen.JaxenException; |
13 | |
import org.jaxen.XPath; |
14 | |
import org.jaxen.javabean.JavaBeanXPath; |
15 | |
|
16 | |
|
17 | 0 | public class BeanPayloadExpressionEvaluator extends AbstractXPathExpressionEvaluator |
18 | |
{ |
19 | |
public static final String NAME = "bean"; |
20 | |
|
21 | |
protected XPath createXPath(String expression, Object object) throws JaxenException |
22 | |
{ |
23 | 0 | expression = expression.replaceAll("[.]", "/"); |
24 | 0 | return new JavaBeanXPath(expression); |
25 | |
} |
26 | |
|
27 | |
protected Object extractResultFromNode(Object result) |
28 | |
{ |
29 | 0 | if(result instanceof org.jaxen.javabean.Element) |
30 | |
{ |
31 | 0 | return ((org.jaxen.javabean.Element)result).getObject(); |
32 | |
} |
33 | 0 | return result; |
34 | |
} |
35 | |
|
36 | |
|
37 | |
public String getName() |
38 | |
{ |
39 | 0 | return NAME; |
40 | |
} |
41 | |
} |