Coverage Report - org.mule.config.spring.parsers.delegate.SingleParentFamilyDefinitionParser
 
Classes in this File Line Coverage Branch Coverage Complexity
SingleParentFamilyDefinitionParser
0%
0/12
0%
0/2
1.5
 
 1  
 /*
 2  
  * $Id: SingleParentFamilyDefinitionParser.java 10256 2008-01-08 15:20:25Z dfeist $
 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.config.spring.parsers.delegate;
 12  
 
 13  
 import org.mule.config.spring.parsers.MuleChildDefinitionParser;
 14  
 import org.mule.config.spring.parsers.MuleDefinitionParser;
 15  
 import org.mule.config.spring.parsers.MuleDefinitionParserConfiguration;
 16  
 
 17  
 public class SingleParentFamilyDefinitionParser extends AbstractSingleParentFamilyDefinitionParser
 18  
 {
 19  
 
 20  
     public SingleParentFamilyDefinitionParser(MuleDefinitionParser parent)
 21  0
     {
 22  
         // avoid the overriden method here
 23  0
         super.addDelegate(parent);
 24  0
         parent.setIgnoredDefault(false);
 25  0
     }
 26  
 
 27  
     protected MuleDefinitionParserConfiguration addDelegate(MuleDefinitionParser delegate)
 28  
     {
 29  0
         throw new UnsupportedOperationException("Delegates must be associated with attribute names");
 30  
     }
 31  
 
 32  
     public SingleParentFamilyDefinitionParser addChildDelegate(String attribute, MuleChildDefinitionParser delegate)
 33  
     {
 34  0
         return addChildDelegate(new String[]{attribute}, delegate);
 35  
     }
 36  
 
 37  
     public SingleParentFamilyDefinitionParser addChildDelegate(String[] attributes, MuleChildDefinitionParser delegate)
 38  
     {
 39  0
         super.addChildDelegate(delegate);
 40  0
         delegate.setIgnoredDefault(true);
 41  0
         for (int i = 0; i < attributes.length; i++)
 42  
         {
 43  0
             getDelegate(0).addIgnored(attributes[i]);
 44  0
             delegate.removeIgnored(attributes[i]);
 45  
         }
 46  0
         return this;
 47  
     }
 48  
 
 49  
 }
 50