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