Coverage Report - org.mule.module.ognl.config.OGNLNamespaceHandler
 
Classes in this File Line Coverage Branch Coverage Complexity
OGNLNamespaceHandler
0%
0/5
N/A
1
OGNLNamespaceHandler$1
N/A
N/A
1
OGNLNamespaceHandler$CDATABeanDefinitionParser
0%
0/5
N/A
1
 
 1  
 /*
 2  
  * $Id: OGNLNamespaceHandler.java 19191 2010-08-25 21:05:23Z tcarlson $
 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.ognl.config;
 11  
 
 12  
 import org.mule.config.spring.parsers.assembly.BeanAssembler;
 13  
 import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
 14  
 import org.mule.module.ognl.filters.OGNLFilter;
 15  
 
 16  
 import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
 17  
 import org.springframework.beans.factory.xml.ParserContext;
 18  
 import org.w3c.dom.Element;
 19  
 
 20  
 /**
 21  
  * Registers Bean Definition Parsers for the "ognl" namespace.
 22  
  */
 23  0
 public class OGNLNamespaceHandler extends NamespaceHandlerSupport
 24  
 {
 25  
 
 26  
     public void init()
 27  
     {
 28  0
         registerBeanDefinitionParser("filter", new ChildDefinitionParser("filter", OGNLFilter.class));
 29  0
         registerBeanDefinitionParser("expression", new CDATABeanDefinitionParser("expression", String.class));
 30  0
     }
 31  
 
 32  0
     private static class CDATABeanDefinitionParser extends
 33  
                                                    ChildDefinitionParser
 34  
     {
 35  
         private CDATABeanDefinitionParser(String setterMethod, Class clazz)
 36  
         {
 37  0
             super(setterMethod, clazz);
 38  0
         }
 39  
 
 40  
         protected void postProcess(ParserContext context, BeanAssembler assembler, Element element)
 41  
         {
 42  0
             assembler.extendTarget(setterMethod, element.getFirstChild().getNodeValue(), false);
 43  0
         }
 44  
     }
 45  
 }