Coverage Report - org.mule.transport.cxf.config.EndpointChildDefinitionParser
 
Classes in this File Line Coverage Branch Coverage Complexity
EndpointChildDefinitionParser
100%
8/8
N/A
1
 
 1  
 /*
 2  
  * $Id: EndpointChildDefinitionParser.java 11101 2008-02-27 22:51:17Z dandiep $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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  
 
 11  
 package org.mule.transport.cxf.config;
 12  
 
 13  
 import org.mule.config.spring.parsers.collection.ChildSingletonMapDefinitionParser;
 14  
 import org.mule.config.spring.parsers.processors.NamedSetterChildElementIterator;
 15  
 import org.mule.config.spring.parsers.processors.AddAttribute;
 16  
 import org.mule.config.spring.parsers.assembly.MapEntryCombiner;
 17  
 import org.mule.config.spring.parsers.assembly.DefaultBeanAssemblerFactory;
 18  
 import org.mule.config.spring.parsers.assembly.configuration.SimplePropertyConfiguration;
 19  
 import org.mule.config.spring.parsers.assembly.configuration.PropertyConfiguration;
 20  
 import org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate;
 21  
 
 22  
 public class EndpointChildDefinitionParser extends ChildSingletonMapDefinitionParser
 23  
 {
 24  
 
 25  
     public static final String PROPERTIES = "properties";
 26  
 
 27  
     public EndpointChildDefinitionParser(String elementName)
 28  
     {
 29  624
         super(PROPERTIES);
 30  624
         addCollection(PROPERTIES);
 31  624
         addBeanFlag(MuleHierarchicalBeanDefinitionParserDelegate.MULE_NO_RECURSE);
 32  624
         PropertyConfiguration configuration = new SimplePropertyConfiguration();
 33  624
         configuration.addCollection(MapEntryCombiner.VALUE);
 34  624
         registerPreProcessor(new AddAttribute(MapEntryCombiner.KEY, elementName));
 35  624
         registerPostProcessor(
 36  
                 new NamedSetterChildElementIterator(
 37  
                         MapEntryCombiner.VALUE, new DefaultBeanAssemblerFactory(), configuration));
 38  624
     }
 39  
 
 40  
 }