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  
  * 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.delegate;
 8  
 
 9  
 import org.mule.config.spring.parsers.MuleChildDefinitionParser;
 10  
 import org.mule.config.spring.parsers.MuleDefinitionParser;
 11  
 import org.mule.config.spring.parsers.MuleDefinitionParserConfiguration;
 12  
 
 13  
 public class SingleParentFamilyDefinitionParser extends AbstractSingleParentFamilyDefinitionParser
 14  
 {
 15  
 
 16  
     public SingleParentFamilyDefinitionParser(MuleDefinitionParser parent)
 17  0
     {
 18  
         // avoid the overriden method here
 19  0
         super.addDelegate(parent);
 20  0
         parent.setIgnoredDefault(false);
 21  0
     }
 22  
 
 23  
     protected MuleDefinitionParserConfiguration addDelegate(MuleDefinitionParser delegate)
 24  
     {
 25  0
         throw new UnsupportedOperationException("Delegates must be associated with attribute names");
 26  
     }
 27  
 
 28  
     public SingleParentFamilyDefinitionParser addChildDelegate(String attribute, MuleChildDefinitionParser delegate)
 29  
     {
 30  0
         return addChildDelegate(new String[]{attribute}, delegate);
 31  
     }
 32  
 
 33  
     public SingleParentFamilyDefinitionParser addChildDelegate(String[] attributes, MuleChildDefinitionParser delegate)
 34  
     {
 35  0
         super.addChildDelegate(delegate);
 36  0
         delegate.setIgnoredDefault(true);
 37  0
         for (int i = 0; i < attributes.length; i++)
 38  
         {
 39  0
             getDelegate(0).addIgnored(attributes[i]);
 40  0
             delegate.removeIgnored(attributes[i]);
 41  
         }
 42  0
         return this;
 43  
     }
 44  
 
 45  
 }
 46