public class NameTransferDefinitionParser extends ParentDefinitionParser
ParentDefinitionParser
so that the "name" attribute is set locally,
not on the parent.
It's easier to understand with an example. Consider a custom security provider, set with the following XML:
<mule:security-manager> <mule:custom-security-provider name="dummySecurityProvider" provider-ref="dummySecurityProvider"/> </mule:security-manager>
What is happening here? First, the custom-security-provider is being handled by this class. Since this class extends ParentDefinitionParser, the provider value is set on the parent (the security manager). But we want the name attribute to be set on the provider (the referenced bean). So the "name" is set on the provider, not on the manager. Then the provider is set on the manager.
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 |
---|
NameTransferDefinitionParser(String componentAttributeName) |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.beans.factory.support.AbstractBeanDefinition |
parseInternal(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext)
Creates a
BeanDefinitionBuilder instance for the bean Class and passes it to the AbstractMuleBeanDefinitionParser.doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder) strategy method. |
getBeanClass, postProcess, processMetadataAnnotations
forceParent, getBeanAssembler, getOrphanBeanAssembler, getParentBeanDefinition, getParentBeanName, getTargetPropertyConfiguration, preProcess
addAlias, addBeanFlag, addCollection, addIgnored, addMapping, addMapping, addMapping, addReference, checkElementNameUnique, createBeanDefinitionBuilder, doParse, getBeanAssemblerFactory, getBeanClassFromAttribute, getBeanName, getClassConstraint, getClassInternal, getParserContext, getRegistry, isAllowClassAttribute, isSingleton, isTopLevel, muleParse, processProperty, registerPostProcessor, registerPreProcessor, removeIgnored, resolveId, setAllowClassAttribute, setBeanAssemblerFactory, setClassConstraint, setIgnoredDefault, setParserContext, setRegistry
parse, postProcessComponentDefinition, registerBeanDefinition, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliases
public NameTransferDefinitionParser(String componentAttributeName)
componentAttributeName
- The attribute name (after processing, which will strip "-ref",
add plurals, etc) that identifies the service which will receive the "name".protected org.springframework.beans.factory.support.AbstractBeanDefinition parseInternal(Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
AbstractMuleBeanDefinitionParser
BeanDefinitionBuilder
instance for the bean Class
and passes it to the AbstractMuleBeanDefinitionParser.doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder)
strategy method.parseInternal
in class ParentDefinitionParser
element
- the element that is to be parsed into a single BeanDefinitionparserContext
- the object encapsulating the current state of the parsing
processElement
AbstractMuleBeanDefinitionParser.doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.