Coverage Report - org.mule.config.spring.parsers.collection.ChildListDefinitionParser
 
Classes in this File Line Coverage Branch Coverage Complexity
ChildListDefinitionParser
0%
0/9
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.config.spring.parsers.collection;
 8  
 
 9  
 import org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate;
 10  
 import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
 11  
 
 12  
 import java.util.ArrayList;
 13  
 import java.util.List;
 14  
 
 15  
 import org.springframework.beans.factory.config.ListFactoryBean;
 16  
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 17  
 import org.springframework.beans.factory.xml.ParserContext;
 18  
 import org.w3c.dom.Element;
 19  
 
 20  
 public class ChildListDefinitionParser extends ChildDefinitionParser
 21  
 {
 22  
 
 23  
     public ChildListDefinitionParser(String setterMethod)
 24  
     {
 25  0
         super(setterMethod, ArrayList.class);
 26  0
         addBeanFlag(MuleHierarchicalBeanDefinitionParserDelegate.MULE_NO_RECURSE);
 27  0
     }
 28  
 
 29  
     protected Class getBeanClass(Element element)
 30  
     {
 31  0
         return ListFactoryBean.class;
 32  
     }
 33  
 
 34  
     protected void parseChild(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
 35  
     {
 36  0
         super.parseChild(element, parserContext, builder);
 37  0
         List parsedList = parserContext.getDelegate().parseListElement(element, builder.getRawBeanDefinition());
 38  0
         builder.addPropertyValue("sourceList", parsedList);
 39  0
         builder.addPropertyValue("targetListClass", super.getBeanClass(element));
 40  0
     }
 41  
 
 42  
 }