Coverage Report - org.mule.module.xml.expression.BeanPayloadExpressionEvaluator
 
Classes in this File Line Coverage Branch Coverage Complexity
BeanPayloadExpressionEvaluator
0%
0/7
0%
0/2
1.667
 
 1  
 /*
 2  
  * $Id: BeanPayloadExpressionEvaluator.java 20321 2010-11-24 15:21:24Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 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  
 /** TODO */
 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  
     /** {@inheritDoc} */
 37  
     public String getName()
 38  
     {
 39  0
         return NAME;
 40  
     }
 41  
 }