org.mule.config.spring.parsers.generic
Class OptionalChildDefinitionParser

java.lang.Object
  extended by org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
      extended by org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser
          extended by org.mule.config.spring.parsers.AbstractHierarchicalDefinitionParser
              extended by org.mule.config.spring.parsers.AbstractChildDefinitionParser
                  extended by org.mule.config.spring.parsers.generic.ChildDefinitionParser
                      extended by org.mule.config.spring.parsers.generic.OptionalChildDefinitionParser
All Implemented Interfaces:
MuleChildDefinitionParser, MuleDefinitionParser, MuleDefinitionParserConfiguration, org.springframework.beans.factory.xml.BeanDefinitionParser
Direct Known Subclasses:
RetryPolicyDefinitionParser, ScriptDefinitionParser

public class OptionalChildDefinitionParser
extends ChildDefinitionParser

This class should be used when the same element can be configured as a child or an orphan (i.e., top-level). It will inject the bean into the parent if the parent exists, otherwise it will not complain (ChildDefinitionParser throws an exception if no parent exists).


Field Summary
 
Fields inherited from class org.mule.config.spring.parsers.generic.ChildDefinitionParser
clazz, setterMethod
 
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, logger, ROOT_ELEMENT, singleton
 
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
 
Constructor Summary
OptionalChildDefinitionParser(String setterMethod)
           
OptionalChildDefinitionParser(String setterMethod, Class clazz)
           
OptionalChildDefinitionParser(String setterMethod, Class clazz, Class constraint)
           
OptionalChildDefinitionParser(String setterMethod, Class clazz, Class constraint, boolean allowClassAttribute)
           
 
Method Summary
 org.springframework.beans.factory.config.BeanDefinition getParentBeanDefinition(Element element)
           
protected  boolean isChild(Element element, org.springframework.beans.factory.xml.ParserContext parserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
           
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.generic.ChildDefinitionParser
getBeanClass, getPropertyName, preProcess
 
Methods inherited from class org.mule.config.spring.parsers.AbstractChildDefinitionParser
doParse, getBeanName
 
Methods inherited from class org.mule.config.spring.parsers.AbstractHierarchicalDefinitionParser
forceParent, getBeanAssembler, getOrphanBeanAssembler, getParentBeanName, getTargetPropertyConfiguration
 
Methods inherited from class org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser
addAlias, addBeanFlag, addCollection, addIgnored, addMapping, addMapping, addMapping, addReference, checkElementNameUnique, createBeanDefinitionBuilder, getBeanAssemblerFactory, 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.mule.config.spring.parsers.MuleChildDefinitionParser
forceParent, getTargetPropertyConfiguration
 
Methods inherited from interface org.mule.config.spring.parsers.MuleDefinitionParser
muleParse, setDeprecationWarning
 
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
 

Constructor Detail

OptionalChildDefinitionParser

public OptionalChildDefinitionParser(String setterMethod)

OptionalChildDefinitionParser

public OptionalChildDefinitionParser(String setterMethod,
                                     Class clazz)

OptionalChildDefinitionParser

public OptionalChildDefinitionParser(String setterMethod,
                                     Class clazz,
                                     Class constraint)

OptionalChildDefinitionParser

public OptionalChildDefinitionParser(String setterMethod,
                                     Class clazz,
                                     Class constraint,
                                     boolean allowClassAttribute)
Method Detail

parseChild

protected void parseChild(Element element,
                          org.springframework.beans.factory.xml.ParserContext parserContext,
                          org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Overrides:
parseChild in class AbstractChildDefinitionParser

isChild

protected boolean isChild(Element element,
                          org.springframework.beans.factory.xml.ParserContext parserContext,
                          org.springframework.beans.factory.support.BeanDefinitionBuilder builder)

getParentBeanDefinition

public org.springframework.beans.factory.config.BeanDefinition getParentBeanDefinition(Element element)
Overrides:
getParentBeanDefinition in class AbstractHierarchicalDefinitionParser

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 AbstractChildDefinitionParser
assembler - the parsed (and probably totally defined) bean definition being built
element - the XML element that was the source of the bean definition's metadata


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.