Coverage Report - org.mule.config.spring.parsers.generic.MuleOrphanDefinitionParser
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleOrphanDefinitionParser
0%
0/9
0%
0/2
1.5
 
 1  
 /*
 2  
  * $Id: MuleOrphanDefinitionParser.java 11433 2008-03-20 03:43:57Z dirk.olmes $
 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  
 package org.mule.config.spring.parsers.generic;
 11  
 
 12  
 import org.mule.config.spring.util.SpringXMLUtils;
 13  
 
 14  
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
 15  
 import org.springframework.beans.factory.xml.ParserContext;
 16  
 import org.w3c.dom.Element;
 17  
 
 18  
 /**
 19  
  * A parser for direct children of the <mule> element.
 20  
  */
 21  
 public class MuleOrphanDefinitionParser extends OrphanDefinitionParser
 22  
 {
 23  
     
 24  
     /**
 25  
      * This constructor assumes that the class name will be explicitly specified as an attribute on the element.
 26  
      */
 27  
     public MuleOrphanDefinitionParser(boolean singleton)
 28  
     {
 29  0
         super(singleton);
 30  0
     }
 31  
 
 32  
     public MuleOrphanDefinitionParser(Class beanClass, boolean singleton)
 33  
     {
 34  0
         super(beanClass, singleton);
 35  0
     }
 36  
 
 37  
     protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext)
 38  
     {
 39  0
         assertMuleParent(element);
 40  0
         return super.parseInternal(element, parserContext);
 41  
     }
 42  
 
 43  
     protected void assertMuleParent(Element element)
 44  
     {
 45  0
         if (!isTopLevel(element))
 46  
         {
 47  0
             throw new IllegalStateException("This element should be embedded inside the Mule <"
 48  
                     + ROOT_ELEMENT + "> element: " + SpringXMLUtils.elementToString(element));
 49  
         }
 50  0
     }
 51  
 
 52  
 }