public abstract class AbstractChildDefinitionParser extends AbstractHierarchicalDefinitionParser implements MuleChildDefinitionParser
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.ATTRIBUTE_CLASS, ATTRIBUTE_ID, ATTRIBUTE_NAME, ATTRIBUTE_REF, ATTRIBUTE_REF_SUFFIX, ATTRIBUTE_REFS, ATTRIBUTE_REFS_SUFFIX, beanPropertyConfiguration, DOMAIN_ROOT_ELEMENT, logger, ROOT_ELEMENT, singleton
Constructor and Description |
---|
AbstractChildDefinitionParser() |
Modifier and Type | Method and Description |
---|---|
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.
|
forceParent, getBeanAssembler, getOrphanBeanAssembler, getParentBeanDefinition, getParentBeanName, getTargetPropertyConfiguration, preProcess
addAlias, addBeanFlag, addCollection, addIgnored, addMapping, addMapping, addMapping, addReference, checkElementNameUnique, createBeanDefinitionBuilder, getBeanAssemblerFactory, getBeanClass, getBeanClassFromAttribute, getClassConstraint, getClassInternal, getParserContext, getRegistry, isAllowClassAttribute, isSingleton, isTopLevel, muleParse, parseInternal, processMetadataAnnotations, processProperty, registerPostProcessor, registerPreProcessor, removeIgnored, resolveId, setAllowClassAttribute, setBeanAssemblerFactory, setClassConstraint, setIgnoredDefault, setParserContext, setRegistry
parse, postProcessComponentDefinition, registerBeanDefinition, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliases
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forceParent, getTargetPropertyConfiguration
muleParse
addAlias, addBeanFlag, addCollection, addIgnored, addMapping, addMapping, addMapping, addReference, registerPostProcessor, registerPreProcessor, removeIgnored, setIgnoredDefault
protected final void doParse(Element element, org.springframework.beans.factory.xml.ParserContext parserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
AbstractMuleBeanDefinitionParser
Element
and populate the supplied
BeanDefinitionBuilder
as required.
The default implementation delegates to the doParse
version
without ParserContext argument.
doParse
in class AbstractMuleBeanDefinitionParser
element
- the XML element being parsedparserContext
- the object encapsulating the current state of the parsing
processbuilder
- used to define the BeanDefinition
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)
AbstractMuleBeanDefinitionParser
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 metadatapublic String getBeanName(Element e)
getBeanName
in interface MuleDefinitionParser
getBeanName
in class AbstractMuleBeanDefinitionParser
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.