Spring 源码解析 -Bean
Spring IOC 定义类
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 to introspect and modify property values and other bean metadata.
Base class for concrete, full-fledged BeanDefinition classes, factoring out common properties of GenericBeanDefinition, RootBeanDefinition, and ChildBeanDefinition.
GenericBeanDefinition is a one-stop shop for standard bean definition purposes. Like any bean definition, it allows for specifying a class plus optionally constructor argument values and property values. Additionally, deriving from a parent bean definition can be flexibly configured through the "parentName" property.
In general, use this GenericBeanDefinition class for the purpose of registering user-visible bean definitions (which a post-processor might operate on, potentially even reconfiguring the parent name). Use RootBeanDefinition / ChildBeanDefinition where parent/child relationships happen to be pre-determined.
Extension of the GenericBeanDefinition class, adding support for annotation metadata exposed through the AnnotatedBeanDefinition interface.
Extension of the GenericBeanDefinition class, based on an ASM ClassReader, with support for annotation metadata exposed through the AnnotatedBeanDefinition interface.
Holder for a BeanDefinition with name and aliases. Can be registered as a placeholder for an inner bean. 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.
ComponentDefinition based on a standard BeanDefinition, exposing the given bean definition as well as inner bean definitions and bean references for the given bean.
Simple interface for bean definition readers. Specifies load methods with Resource and String location parameters.
Abstract base class for bean definition readers which implement the BeanDefinitionReader interface.
Bean definition reader for a simple properties format.
Bean definition reader for XML bean definitions. Delegates the actual XML document reading to an implementation of the BeanDefinitionDocumentReader interface.
Interface used by the DefaultBeanDefinitionDocumentReader to handle custom, top-level (directly under <beans/>) tags.
Abstract BeanDefinitionParser implementation providing a number of convenience methods and a AbstractBeanDefinitionParser#parseInternal template method that subclasses must override to provide the actual parsing logic.
Base class for those BeanDefinitionParser implementations that need to parse and define just a single BeanDefinition
Convenient base class for when there exists a one-to-one mapping between attribute names on the element that is to be parsed and the property names on the Class being configured.
Common interface for managing aliases. Serves as super-interface for BeanDefinitionRegistry
Interface for registries that hold bean definitions, for example RootBeanDefinition and ChildBeanDefinition instances. Typically implemented by BeanFactories that internally work with the AbstractBeanDefinition hierarchy.
Spring's default implementation of the ConfigurableListableBeanFactory and BeanDefinitionRegistry interfaces: a full-fledged bean factory based on bean definition metadata, extensible through post-processors.
Typical usage is registering all bean definitions first (possibly read from a bean definition file), before accessing beans. Bean lookup by name is therefore an inexpensive operation in a local bean definition table, operating on pre-resolved bean definition metadata objects.
Interface that exposes a reference to a bean name in an abstract fashion. Serves as common interface implemented by any kind of bean reference holder, such as RuntimeBeanReference and RuntimeBeanNameReference.
Immutable placeholder class used for a property value object when it's a reference to another bean in the factory, to be resolved at runtime.
Immutable placeholder class used for a property value object when it's a reference to another bean name in the factory, to be resolved at runtime.