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; 8 9 import org.springframework.beans.factory.support.AbstractBeanDefinition; 10 import org.springframework.beans.factory.xml.BeanDefinitionParser; 11 import org.springframework.beans.factory.xml.ParserContext; 12 import org.w3c.dom.Element; 13 14 /** 15 * This is the interface all Mule BDPs implement. It is a bit odd because it had to be retro-fitted 16 * to existing code. In particular {@link BeanDefinitionParser#parse(Element, ParserContext)} 17 * and {@link #muleParse(Element, ParserContext)} seem to duplicate each other. This is because 18 * many Mule classes subclass a Spring helper which makes <code>parse()</code> final. So instead 19 * we need to use {@link #muleParse(Element, ParserContext)}, to allow over-rides. 20 * <p> 21 * In case that's not clear - always call {@link #muleParse(Element, ParserContext)} rather than 22 * {@link BeanDefinitionParser#parse(Element, ParserContext)}. The {@link BeanDefinitionParser} 23 * is here only to allow the BDP to be handed over to Spring. 24 */ 25 public interface MuleDefinitionParser extends BeanDefinitionParser, MuleDefinitionParserConfiguration 26 { 27 28 AbstractBeanDefinition muleParse(Element element, ParserContext parserContext); 29 30 String getBeanName(Element element); 31 32 void setDeprecationWarning(String deprecationWarning); 33 }