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, processMetadataAnnotationsforceParent, getBeanAssembler, getOrphanBeanAssembler, getParentBeanDefinition, getParentBeanName, getParentElement, getTargetPropertyConfiguration, preProcessaddAlias, addBeanFlag, addCollection, addIgnored, addMapping, addMapping, addMapping, addReference, checkElementNameUnique, createBeanDefinitionBuilder, doParse, getBeanAssemblerFactory, getBeanClassFromAttribute, getBeanName, getClassConstraint, getClassInternal, getConfigFileIdentifier, getParserContext, getRegistry, isAllowClassAttribute, isSingleton, isTopLevel, muleParse, processMetadataAnnotationsHelper, processProperty, registerPostProcessor, registerPreProcessor, removeIgnored, resolveId, setAllowClassAttribute, setBeanAssemblerFactory, setClassConstraint, setIgnoredDefault, setParserContext, setRegistryparse, postProcessComponentDefinition, registerBeanDefinition, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliasespublic 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)
AbstractMuleBeanDefinitionParserBeanDefinitionBuilder 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 ParentDefinitionParserelement - the element that is to be parsed into a single BeanDefinitionparserContext - the object encapsulating the current state of the parsing processElementAbstractMuleBeanDefinitionParser.doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder)Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.