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