Coverage Report - org.mule.config.spring.parsers.specific.ServiceDefinitionParser
 
Classes in this File Line Coverage Branch Coverage Complexity
ServiceDefinitionParser
0%
0/11
N/A
0
 
 1  
 /*
 2  
  * $Id: ServiceDefinitionParser.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  
 
 11  
 package org.mule.config.spring.parsers.specific;
 12  
 
 13  
 import org.mule.config.spring.parsers.generic.OrphanDefinitionParser;
 14  
 import org.mule.config.spring.parsers.processors.ProvideDefaultName;
 15  
 
 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 ServiceDefinitionParser extends OrphanDefinitionParser
 21  
 {
 22  
 
 23  
     // for custom services
 24  
     public ServiceDefinitionParser()
 25  
     {
 26  0
         super(true);
 27  0
         registerPreProcessor(new ProvideDefaultName("service"));
 28  0
     }
 29  
 
 30  
     public ServiceDefinitionParser(Class clazz)
 31  
     {
 32  0
         super(clazz, true);
 33  0
         registerPreProcessor(new ProvideDefaultName("service"));
 34  0
     }
 35  
 
 36  
     @java.lang.Override
 37  
     protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
 38  
     {
 39  0
         Element parent = (Element) element.getParentNode();
 40  0
         String modelName = parent.getAttribute(ATTRIBUTE_NAME);
 41  0
         builder.addPropertyReference("model", modelName);
 42  0
         super.doParse(element, parserContext, builder);
 43  0
     }
 44  
 
 45  
 }