org.mule.config.spring.parsers
Class AbstractChildDefinitionParser
java.lang.Object
org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser
org.mule.config.spring.parsers.AbstractHierarchicalDefinitionParser
org.mule.config.spring.parsers.AbstractChildDefinitionParser
- All Implemented Interfaces:
- MuleChildDefinitionParser, MuleDefinitionParser, MuleDefinitionParserConfiguration, org.springframework.beans.factory.xml.BeanDefinitionParser
- Direct Known Subclasses:
- AttributeListEntryDefinitionParser, ChildDefinitionParser, ObjectFactoryDefinitionParser
public abstract class AbstractChildDefinitionParser
- extends AbstractHierarchicalDefinitionParser
- implements MuleChildDefinitionParser
This definition parser supports the definition of beans that are then set on the parent bean -
it extends AbstractHierarchicalDefinitionParser
with
methods that assume the data are associated with a single property.
This supports collections and Maps. For collections if a child element is repeated it will be assumed
that it is a collection.
If the Bean Class for this element is set to
ChildMapEntryDefinitionParser.KeyValuePair
it is assumed that a Map
is being processed and any child elements will be added to the parent Map. Similarly for
ChildListEntryDefinitionParser
.
A single method needs to be overriden called getPropertyName(org.w3c.dom.Element)
that determines the name of the property to
set on the parent bean with this bean. Note that the property name can be dynamically resolved depending on the parent
element.
- See Also:
ChildDefinitionParser
,
ChildMapEntryDefinitionParser.KeyValuePair
,
AbstractMuleBeanDefinitionParser
Fields inherited from class org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser |
ATTRIBUTE_CLASS, ATTRIBUTE_ID, ATTRIBUTE_NAME, ATTRIBUTE_REF, ATTRIBUTE_REF_SUFFIX, ATTRIBUTE_REFS, ATTRIBUTE_REFS_SUFFIX, beanPropertyConfiguration, DOMAIN_ROOT_ELEMENT, logger, ROOT_ELEMENT, singleton |
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser |
ID_ATTRIBUTE, NAME_ATTRIBUTE |
Method Summary |
protected void |
doParse(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext,
org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Parse the supplied Element and populate the supplied
BeanDefinitionBuilder as required. |
String |
getBeanName(Element e)
|
abstract String |
getPropertyName(Element element)
|
protected void |
parseChild(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext,
org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
|
protected void |
postProcess(org.springframework.beans.factory.xml.ParserContext context,
BeanAssembler assembler,
Element element)
Hook method that derived classes can implement to inspect/change a
bean definition after parsing is complete. |
Methods inherited from class org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser |
addAlias, addBeanFlag, addCollection, addIgnored, addMapping, addMapping, addMapping, addReference, checkElementNameUnique, createBeanDefinitionBuilder, getBeanAssemblerFactory, getBeanClass, getBeanClassFromAttribute, getClassConstraint, getClassInternal, getParserContext, getRegistry, isAllowClassAttribute, isSingleton, isTopLevel, muleParse, parseInternal, processProperty, registerPostProcessor, registerPreProcessor, removeIgnored, resolveId, setAllowClassAttribute, setBeanAssemblerFactory, setClassConstraint, setDeprecationWarning, setIgnoredDefault, setParserContext, setRegistry |
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser |
parse, postProcessComponentDefinition, registerBeanDefinition, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.beans.factory.xml.BeanDefinitionParser |
parse |
Methods inherited from interface org.mule.config.spring.parsers.MuleDefinitionParserConfiguration |
addAlias, addBeanFlag, addCollection, addIgnored, addMapping, addMapping, addMapping, addReference, registerPostProcessor, registerPreProcessor, removeIgnored, setIgnoredDefault |
AbstractChildDefinitionParser
public AbstractChildDefinitionParser()
doParse
protected final void doParse(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext,
org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
- Description copied from class:
AbstractMuleBeanDefinitionParser
- Parse the supplied
Element
and populate the supplied
BeanDefinitionBuilder
as required.
The default implementation delegates to the doParse
version
without ParserContext argument.
- Overrides:
doParse
in class AbstractMuleBeanDefinitionParser
- Parameters:
element
- the XML element being parsedparserContext
- the object encapsulating the current state of the parsing
processbuilder
- used to define the BeanDefinition
parseChild
protected void parseChild(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext,
org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
postProcess
protected void postProcess(org.springframework.beans.factory.xml.ParserContext context,
BeanAssembler assembler,
Element element)
- Description copied from class:
AbstractMuleBeanDefinitionParser
- Hook method that derived classes can implement to inspect/change a
bean definition after parsing is complete.
- Overrides:
postProcess
in class AbstractHierarchicalDefinitionParser
assembler
- the parsed (and probably totally defined) bean definition being builtelement
- the XML element that was the source of the bean definition's metadata
getBeanName
public String getBeanName(Element e)
- Specified by:
getBeanName
in interface MuleDefinitionParser
- Overrides:
getBeanName
in class AbstractMuleBeanDefinitionParser
getPropertyName
public abstract String getPropertyName(Element element)
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.