Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » beans » factory » config » [javadoc | source]
org.springframework.beans.factory.config
public interface: BeanDefinition [javadoc | source]

All Implemented Interfaces:
    AttributeAccessor, BeanMetadataElement

All Known Implementing Classes:
    AnnotatedGenericBeanDefinition, AnnotatedBeanDefinition, AbstractBeanDefinition, ChildBeanDefinition, ScannedGenericBeanDefinition, RootBeanDefinition, GenericBeanDefinition

A BeanDefinition describes a bean instance, which has property values, constructor argument values, and further information supplied by concrete implementations.

This is just a minimal interface: The main intention is to allow a BeanFactoryPostProcessor such as PropertyPlaceholderConfigurer to introspect and modify property values and other bean metadata.

Field Summary
 String SCOPE_SINGLETON    Scope identifier for the standard singleton scope: "singleton".

Note that extended bean factories might support further scopes.

 
 String SCOPE_PROTOTYPE    Scope identifier for the standard prototype scope: "prototype".

Note that extended bean factories might support further scopes.

 
 int ROLE_APPLICATION    Role hint indicating that a BeanDefinition is a major part of the application. Typically corresponds to a user-defined bean. 
 int ROLE_SUPPORT    Role hint indicating that a BeanDefinition is a supporting part of some larger configuration, typically an outer org.springframework.beans.factory.parsing.ComponentDefinition . SUPPORT beans are considered important enough to be aware of when looking more closely at a particular org.springframework.beans.factory.parsing.ComponentDefinition , but not when looking at the overall configuration of an application. 
 int ROLE_INFRASTRUCTURE    Role hint indicating that a BeanDefinition is providing an entirely background role and has no relevance to the end-user. This hint is used when registering beans that are completely part of the internal workings of a org.springframework.beans.factory.parsing.ComponentDefinition
Method from org.springframework.beans.factory.config.BeanDefinition Summary:
getBeanClassName,   getConstructorArgumentValues,   getDescription,   getFactoryBeanName,   getFactoryMethodName,   getOriginatingBeanDefinition,   getParentName,   getPropertyValues,   getResourceDescription,   getRole,   getScope,   isAbstract,   isAutowireCandidate,   isLazyInit,   isSingleton,   setAutowireCandidate,   setBeanClassName,   setFactoryBeanName,   setFactoryMethodName,   setParentName,   setScope
Method from org.springframework.beans.factory.config.BeanDefinition Detail:
 public String getBeanClassName()
    Return the current bean class name of this bean definition.

    Note that this does not have to be the actual class name used at runtime, in case of a child definition overriding/inheriting the class name from its parent. Hence, do not consider this to be the definitive bean type at runtime but rather only use it for parsing purposes at the individual bean definition level.

 public ConstructorArgumentValues getConstructorArgumentValues()
    Return the constructor argument values for this bean.

    The returned instance can be modified during bean factory post-processing.

 public String getDescription()
    Return a human-readable description of this bean definition.
 public String getFactoryBeanName()
    Return the factory bean name, if any.
 public String getFactoryMethodName()
    Return a factory method, if any.
 public BeanDefinition getOriginatingBeanDefinition()
    Return the originating BeanDefinition, or null if none. Allows for retrieving the decorated bean definition, if any.

    Note that this method returns the immediate originator. Iterate through the originator chain to find the original BeanDefinition as defined by the user.

 public String getParentName()
    Return the name of the parent definition of this bean definition, if any.
 public MutablePropertyValues getPropertyValues()
    Return the property values to be applied to a new instance of the bean.

    The returned instance can be modified during bean factory post-processing.

 public String getResourceDescription()
    Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
 public int getRole()
    Get the role hint for this BeanDefinition. The role hint provides tools with an indication of the importance of a particular BeanDefinition.
 public String getScope()
    Return the name of the current target scope for this bean.
 public boolean isAbstract()
    Return whether this bean is "abstract", that is, not meant to be instantiated.
 public boolean isAutowireCandidate()
    Return whether this bean is a candidate for getting autowired into some other bean.
 public boolean isLazyInit()
    Return whether this bean should be lazily initialized, that is, not eagerly instantiated on startup.
 public boolean isSingleton()
    Return whether this a Singleton, with a single, shared instance returned on all calls.
 public  void setAutowireCandidate(boolean autowireCandidate)
    Set whether this bean is a candidate for getting autowired into some other bean.
 public  void setBeanClassName(String beanClassName)
    Override the bean class name of this bean definition.

    The class name can be modified during bean factory post-processing, typically replacing the original class name with a parsed variant of it.

 public  void setFactoryBeanName(String factoryBeanName)
    Specify the factory bean to use, if any.
 public  void setFactoryMethodName(String factoryMethodName)
    Specify a factory method, if any. This method will be invoked with constructor arguments, or with no arguments if none are specified. The method will be invoked on the specifed factory bean, if any, or as static method on the local bean class else.
 public  void setParentName(String parentName)
    Set the name of the parent definition of this bean definition, if any.
 public  void setScope(String scope)
    Override the target scope of this bean, specifying a new scope name.