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  
  * 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.specific;
 8  
 
 9  
 import org.mule.config.spring.parsers.generic.OrphanDefinitionParser;
 10  
 import org.mule.config.spring.parsers.processors.ProvideDefaultName;
 11  
 
 12  
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 13  
 import org.springframework.beans.factory.xml.ParserContext;
 14  
 import org.w3c.dom.Element;
 15  
 
 16  
 public class ServiceDefinitionParser extends OrphanDefinitionParser
 17  
 {
 18  
 
 19  
     // for custom services
 20  
     public ServiceDefinitionParser()
 21  
     {
 22  0
         super(true);
 23  0
         registerPreProcessor(new ProvideDefaultName("service"));
 24  0
     }
 25  
 
 26  
     public ServiceDefinitionParser(Class clazz)
 27  
     {
 28  0
         super(clazz, true);
 29  0
         registerPreProcessor(new ProvideDefaultName("service"));
 30  0
     }
 31  
 
 32  
     @java.lang.Override
 33  
     protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
 34  
     {
 35  0
         Element parent = (Element) element.getParentNode();
 36  0
         String modelName = parent.getAttribute(ATTRIBUTE_NAME);
 37  0
         builder.addPropertyReference("model", modelName);
 38  0
         super.doParse(element, parserContext, builder);
 39  0
     }
 40  
 
 41  
 }