org.springframework.beans.factory.config
Class BeanDefinitionHolder

java.lang.Object
  extended by org.springframework.beans.factory.config.BeanDefinitionHolder

public class BeanDefinitionHolder
extends Object

Holder for a BeanDefinition with name and aliases. Can be registered as a placeholder for an inner bean.

Recognized by AbstractAutowireCapableBeanFactory for inner bean definitions. Registered by DefaultXmlBeanDefinitionParser, which also uses it as general holder for a parsed bean definition.

Can also be used for programmatic registration of inner bean definitions. If you don't care about BeanNameAware and the like, registering RootBeanDefinition or ChildBeanDefinition is good enough.

Since:
1.0.2
Author:
Juergen Hoeller
See Also:
BeanNameAware, RootBeanDefinition, ChildBeanDefinition

Constructor Summary
BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName)
          Create a new BeanDefinitionHolder.
BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName, String[] aliases)
          Create a new BeanDefinitionHolder.
 
Method Summary
 String[] getAliases()
          Return the alias names for the bean, as specified directly for the bean definition.
 BeanDefinition getBeanDefinition()
          Return the wrapped BeanDefinition.
 String getBeanName()
          Return the primary name of the bean, as specified for the bean definition.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanDefinitionHolder

public BeanDefinitionHolder(BeanDefinition beanDefinition,
                            String beanName)
Create a new BeanDefinitionHolder.

Parameters:
beanDefinition - the BeanDefinition to wrap
beanName - the name of the bean, as specified for the bean definition

BeanDefinitionHolder

public BeanDefinitionHolder(BeanDefinition beanDefinition,
                            String beanName,
                            String[] aliases)
Create a new BeanDefinitionHolder.

Parameters:
beanDefinition - the BeanDefinition to wrap
beanName - the name of the bean, as specified for the bean definition
aliases - alias names for the bean, or null if none
Method Detail

getBeanDefinition

public BeanDefinition getBeanDefinition()
Return the wrapped BeanDefinition.


getBeanName

public String getBeanName()
Return the primary name of the bean, as specified for the bean definition.


getAliases

public String[] getAliases()
Return the alias names for the bean, as specified directly for the bean definition.

Returns:
the array of alias names, or null if none

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2002-2007 The Spring Framework Project.