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  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.module.ognl.config;
 8  
 
 9  
 import org.mule.config.spring.parsers.assembly.BeanAssembler;
 10  
 import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
 11  
 import org.mule.config.spring.parsers.specific.FilterDefinitionParser;
 12  
 import org.mule.module.ognl.filters.OGNLFilter;
 13  
 
 14  
 import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
 15  
 import org.springframework.beans.factory.xml.ParserContext;
 16  
 import org.w3c.dom.Element;
 17  
 
 18  
 /**
 19  
  * Registers Bean Definition Parsers for the "ognl" namespace.
 20  
  */
 21  0
 public class OGNLNamespaceHandler extends NamespaceHandlerSupport
 22  
 {
 23  
 
 24  
     public void init()
 25  
     {
 26  0
         registerBeanDefinitionParser("filter", new FilterDefinitionParser(OGNLFilter.class));
 27  0
         registerBeanDefinitionParser("expression", new CDATABeanDefinitionParser("expression", String.class));
 28  0
     }
 29  
 
 30  0
     private static class CDATABeanDefinitionParser extends
 31  
                                                    ChildDefinitionParser
 32  
     {
 33  
         private CDATABeanDefinitionParser(String setterMethod, Class clazz)
 34  
         {
 35  0
             super(setterMethod, clazz);
 36  0
         }
 37  
 
 38  
         protected void postProcess(ParserContext context, BeanAssembler assembler, Element element)
 39  
         {
 40  0
             assembler.extendTarget(setterMethod, element.getFirstChild().getNodeValue(), false);
 41  0
         }
 42  
     }
 43  
 }