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