java.lang.Object | |||
↳ | org.springframework.core.AttributeAccessorSupport | ||
↳ | org.springframework.beans.BeanMetadataAttributeAccessor | ||
↳ | org.springframework.beans.factory.support.AbstractBeanDefinition |
Known Direct Subclasses |
Known Indirect Subclasses |
Base class for concrete, full-fledged
BeanDefinition
classes,
factoring out common properties of RootBeanDefinition
and
ChildBeanDefinition
.
The autowire constants match the ones defined in the
AutowireCapableBeanFactory
interface.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | AUTOWIRE_AUTODETECT | This constant is deprecated. as of Spring 3.0: If you are using mixed autowiring strategies, use annotation-based autowiring for clearer demarcation of autowiring needs. | |||||||||
int | AUTOWIRE_BY_NAME | Constant that indicates autowiring bean properties by name. | |||||||||
int | AUTOWIRE_BY_TYPE | Constant that indicates autowiring bean properties by type. | |||||||||
int | AUTOWIRE_CONSTRUCTOR | Constant that indicates autowiring a constructor. | |||||||||
int | AUTOWIRE_NO | Constant that indicates no autowiring at all. | |||||||||
int | DEPENDENCY_CHECK_ALL | Constant that indicates dependency checking for all properties (object references as well as "simple" properties). | |||||||||
int | DEPENDENCY_CHECK_NONE | Constant that indicates no dependency check at all. | |||||||||
int | DEPENDENCY_CHECK_OBJECTS | Constant that indicates dependency checking for object references. | |||||||||
int | DEPENDENCY_CHECK_SIMPLE | Constant that indicates dependency checking for "simple" properties. | |||||||||
String | SCOPE_DEFAULT | Constant for the default scope name: "", equivalent to singleton status but to be overridden from a parent bean definition (if applicable). |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.springframework.beans.factory.config.BeanDefinition
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new AbstractBeanDefinition with default settings.
| |||||||||||
Create a new AbstractBeanDefinition with the given
constructor argument values and property values.
| |||||||||||
This constructor is deprecated.
since Spring 2.5, in favor of
AbstractBeanDefinition(BeanDefinition)
| |||||||||||
Create a new AbstractBeanDefinition as deep copy of the given
bean definition.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Register a qualifier to be used for autowire candidate resolution,
keyed by the qualifier's type name.
| |||||||||||
Apply the provided default values to this bean.
| |||||||||||
Public declaration of Object's
clone() method. | |||||||||||
Clone this bean definition.
| |||||||||||
Copy the qualifiers from the supplied AbstractBeanDefinition to this bean definition.
| |||||||||||
Return the autowire mode as specified in the bean definition.
| |||||||||||
Return the class of the wrapped bean, if already resolved.
| |||||||||||
Return the current bean class name of this bean definition.
| |||||||||||
Return constructor argument values for this bean (never
null ). | |||||||||||
Return the dependency check code.
| |||||||||||
Return the bean names that this bean depends on.
| |||||||||||
Return a human-readable description of this bean definition.
| |||||||||||
Return the name of the destroy method.
| |||||||||||
Return the factory bean name, if any.
| |||||||||||
Return a factory method, if any.
| |||||||||||
Return the name of the initializer method.
| |||||||||||
Return information about methods to be overridden by the IoC
container.
| |||||||||||
Return the originating BeanDefinition, or
null if none. | |||||||||||
Return property values for this bean (never
null ). | |||||||||||
Return the qualifier mapped to the provided type name.
| |||||||||||
Return all registered qualifiers.
| |||||||||||
Return the resolved autowire code,
(resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE).
| |||||||||||
Return the resource that this bean definition came from.
| |||||||||||
Return a description of the resource that this bean definition
came from (for the purpose of showing context in case of errors).
| |||||||||||
Return the role hint for this
BeanDefinition . | |||||||||||
Return the name of the target scope for the bean.
| |||||||||||
Return whether this definition specifies a bean class.
| |||||||||||
Return if there are constructor argument values defined for this bean.
| |||||||||||
Return whether this bean has the specified qualifier.
| |||||||||||
Return whether this bean is "abstract", i.e.
| |||||||||||
Return whether this bean is a candidate for getting autowired into some other bean.
| |||||||||||
Indicate whether the configured destroy method is the default.
| |||||||||||
Indicate whether the configured init method is the default.
| |||||||||||
Return whether this bean should be lazily initialized, i.e.
| |||||||||||
Return whether to resolve constructors in lenient mode or in strict mode.
| |||||||||||
Return whether to allow access to non-public constructors and methods.
| |||||||||||
Return whether this bean is a primary autowire candidate.
| |||||||||||
Return whether this a Prototype, with an independent instance
returned for each call.
| |||||||||||
Return whether this a Singleton, with a single shared instance
returned from all calls.
| |||||||||||
Return whether this bean definition is 'synthetic', that is,
not defined by the application itself.
| |||||||||||
This method is deprecated.
since Spring 2.5, in favor of
overrideFrom(BeanDefinition)
| |||||||||||
Override settings in this bean definition (assumably a copied parent
from a parent-child inheritance relationship) from the given bean
definition (assumably the child).
| |||||||||||
Validate and prepare the method overrides defined for this bean.
| |||||||||||
Determine the class of the wrapped bean, resolving it from a
specified class name if necessary.
| |||||||||||
Set if this bean is "abstract", i.e.
| |||||||||||
Set whether this bean is a candidate for getting autowired into some other bean.
| |||||||||||
Set the autowire mode.
| |||||||||||
Specify the class for this bean.
| |||||||||||
Override the bean class name of this bean definition.
| |||||||||||
Specify constructor argument values for this bean.
| |||||||||||
Set the dependency check code.
| |||||||||||
Set the names of the beans that this bean depends on being initialized.
| |||||||||||
Set a human-readable description of this bean definition.
| |||||||||||
Set the name of the destroy method.
| |||||||||||
Specify whether or not the configured destroy method is the default.
| |||||||||||
Specify whether or not the configured init method is the default.
| |||||||||||
Specify the factory bean to use, if any.
| |||||||||||
Specify a factory method, if any.
| |||||||||||
Set the name of the initializer method.
| |||||||||||
Set whether this bean should be lazily initialized.
| |||||||||||
Specify whether to resolve constructors in lenient mode (
true ,
which is the default) or to switch to strict resolution (throwing an exception
in case of ambigious constructors that all match when converting the arguments,
whereas lenient mode would use the one with the 'closest' type matches). | |||||||||||
Specify method overrides for the bean, if any.
| |||||||||||
Specify whether to allow access to non-public constructors and methods,
for the case of externalized metadata pointing to those.
| |||||||||||
Set the originating (e.g.
| |||||||||||
Set whether this bean is a primary autowire candidate.
| |||||||||||
Specify property values for this bean, if any.
| |||||||||||
Set the resource that this bean definition came from
(for the purpose of showing context in case of errors).
| |||||||||||
Set a description of the resource that this bean definition
came from (for the purpose of showing context in case of errors).
| |||||||||||
Set the role hint for this
BeanDefinition . | |||||||||||
Set the name of the target scope for the bean.
| |||||||||||
This method is deprecated.
since Spring 2.5, in favor of
setScope(String) | |||||||||||
Set whether this bean definition is 'synthetic', that is, not defined
by the application itself (for example, an infrastructure bean such
as a helper for auto-proxying, created through
<aop:config> ). | |||||||||||
Validate this bean definition.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Validate and prepare the given method override.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.beans.BeanMetadataAttributeAccessor
| |||||||||||
From class
org.springframework.core.AttributeAccessorSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.BeanMetadataElement
| |||||||||||
From interface
org.springframework.beans.factory.config.BeanDefinition
| |||||||||||
From interface
org.springframework.core.AttributeAccessor
|
This constant is deprecated.
as of Spring 3.0: If you are using mixed autowiring strategies,
use annotation-based autowiring for clearer demarcation of autowiring needs.
Constant that indicates determining an appropriate autowire strategy through introspection of the bean class.
Constant that indicates autowiring bean properties by name.
Constant that indicates autowiring bean properties by type.
Constant that indicates autowiring a constructor.
Constant that indicates no autowiring at all.
Constant that indicates dependency checking for all properties (object references as well as "simple" properties).
Constant that indicates no dependency check at all.
Constant that indicates dependency checking for object references.
Constant that indicates dependency checking for "simple" properties.
Constant for the default scope name: "", equivalent to singleton status but to be overridden from a parent bean definition (if applicable).
Create a new AbstractBeanDefinition with default settings.
Create a new AbstractBeanDefinition with the given constructor argument values and property values.
This constructor is deprecated.
since Spring 2.5, in favor of AbstractBeanDefinition(BeanDefinition)
Create a new AbstractBeanDefinition as deep copy of the given bean definition.
original | the original bean definition to copy from |
---|
Create a new AbstractBeanDefinition as deep copy of the given bean definition.
original | the original bean definition to copy from |
---|
Register a qualifier to be used for autowire candidate resolution, keyed by the qualifier's type name.
Apply the provided default values to this bean.
defaults | the defaults to apply |
---|
Public declaration of Object's clone()
method.
Delegates to cloneBeanDefinition()
.
Clone this bean definition. To be implemented by concrete subclasses.
Copy the qualifiers from the supplied AbstractBeanDefinition to this bean definition.
source | the AbstractBeanDefinition to copy from |
---|
Return the autowire mode as specified in the bean definition.
Return the class of the wrapped bean, if already resolved.
null
if none definedIllegalStateException | if the bean definition does not define a bean class, or a specified bean class name has not been resolved into an actual Class |
---|
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.
Return constructor argument values for this bean (never null
).
null
)
Return a human-readable description of this bean definition.
Return information about methods to be overridden by the IoC container. This will be empty if there are no method overrides. Never returns null.
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.
Return property values for this bean (never null
).
null
)
Return the qualifier mapped to the provided type name.
Return all registered qualifiers.
AutowireCandidateQualifier
objects.
Return the resolved autowire code, (resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE).
Return the resource that this bean definition came from.
Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
Return whether this definition specifies a bean class.
Return if there are constructor argument values defined for this bean.
Return whether this bean has the specified qualifier.
Return whether this bean is "abstract", i.e. not meant to be instantiated itself but rather just serving as parent for concrete child bean definitions.
Return whether this bean is a candidate for getting autowired into some other bean.
Indicate whether the configured destroy method is the default.
Indicate whether the configured init method is the default.
Return whether this bean should be lazily initialized, i.e. not eagerly instantiated on startup. Only applicable to a singleton bean.
Return whether to resolve constructors in lenient mode or in strict mode.
Return whether to allow access to non-public constructors and methods.
Return whether this bean is a primary autowire candidate. If this value is true for exactly one bean among multiple matching candidates, it will serve as a tie-breaker.
Return whether this a Prototype, with an independent instance returned for each call.
Return whether this a Singleton, with a single shared instance returned from all calls.
Return whether this bean definition is 'synthetic', that is, not defined by the application itself.
This method is deprecated.
since Spring 2.5, in favor of overrideFrom(BeanDefinition)
Override settings in this bean definition (assumably a copied parent from a parent-child inheritance relationship) from the given bean definition (assumably the child).
Override settings in this bean definition (assumably a copied parent from a parent-child inheritance relationship) from the given bean definition (assumably the child).
abstract
, scope
,
lazyInit
, autowireMode
, dependencyCheck
,
and dependsOn
from the given bean definition.
constructorArgumentValues
, propertyValues
,
methodOverrides
from the given bean definition to existing ones.
factoryBeanName
, factoryMethodName
,
initMethodName
, and destroyMethodName
if specified
in the given bean definition.
Validate and prepare the method overrides defined for this bean. Checks for existence of a method with the specified name.
BeanDefinitionValidationException | in case of validation failure |
---|
Determine the class of the wrapped bean, resolving it from a specified class name if necessary. Will also reload a specified Class from its name when called with the bean class already resolved.
classLoader | the ClassLoader to use for resolving a (potential) class name |
---|
ClassNotFoundException | if the class name could be resolved |
---|
Set if this bean is "abstract", i.e. not meant to be instantiated itself but rather just serving as parent for concrete child bean definitions.
Default is "false". Specify true to tell the bean factory to not try to instantiate that particular bean in any case.
Set whether this bean is a candidate for getting autowired into some other bean.
Set the autowire mode. This determines whether any automagical detection and setting of bean references will happen. Default is AUTOWIRE_NO, which means there's no autowire.
autowireMode | the autowire mode to set. Must be one of the constants defined in this class. |
---|
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.
Specify constructor argument values for this bean.
Set the dependency check code.
dependencyCheck | the code to set. Must be one of the four constants defined in this class. |
---|
Set the names of the beans that this bean depends on being initialized. The bean factory will guarantee that these beans get initialized first.
Note that dependencies are normally expressed through bean properties or constructor arguments. This property should just be necessary for other kinds of dependencies like statics (*ugh*) or database preparation on startup.
Set a human-readable description of this bean definition.
Set the name of the destroy method. The default is null
in which case there is no destroy method.
Specify whether or not the configured destroy method is the default.
Default value is false
.
Specify whether or not the configured init method is the default.
Default value is false
.
Specify the factory bean to use, if any.
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 specified factory bean, if any, or otherwise as a static method on the local bean class.
factoryMethodName | static factory method name,
or null if normal constructor creation should be used |
---|
Set the name of the initializer method. The default is null
in which case there is no initializer method.
Set whether this bean should be lazily initialized.
If false
, the bean will get instantiated on startup by bean
factories that perform eager initialization of singletons.
Specify whether to resolve constructors in lenient mode (true
,
which is the default) or to switch to strict resolution (throwing an exception
in case of ambigious constructors that all match when converting the arguments,
whereas lenient mode would use the one with the 'closest' type matches).
Specify method overrides for the bean, if any.
Specify whether to allow access to non-public constructors and methods, for the case of externalized metadata pointing to those.
This applies to constructor resolution, factory method resolution, and also init/destroy methods. Bean property accessors have to be public in any case and are not affected by this setting.
Note that annotation-driven configuration will still access non-public members as far as they have been annotated. This setting applies to externalized metadata in this bean definition only.
Set the originating (e.g. decorated) BeanDefinition, if any.
Set whether this bean is a primary autowire candidate. If this value is true for exactly one bean among multiple matching candidates, it will serve as a tie-breaker.
Specify property values for this bean, if any.
Set the resource that this bean definition came from (for the purpose of showing context in case of errors).
Set a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
Set the name of the target scope for the bean.
Default is singleton status, although this is only applied once a bean definition becomes active in the containing factory. A bean definition may eventually inherit its scope from a parent bean definitionFor this reason, the default scope name is empty (empty String), with singleton status being assumed until a resolved scope will be set.
This method is deprecated.
since Spring 2.5, in favor of setScope(String)
Set if this a Singleton, with a single, shared instance returned on all calls. In case of "false", the BeanFactory will apply the Prototype design pattern, with each caller requesting an instance getting an independent instance. How this is exactly defined will depend on the BeanFactory.
"Singletons" are the commoner type, so the default is "true". Note that as of Spring 2.0, this flag is just an alternative way to specify scope="singleton" or scope="prototype".
Set whether this bean definition is 'synthetic', that is, not defined
by the application itself (for example, an infrastructure bean such
as a helper for auto-proxying, created through <aop:config>
).
Validate this bean definition.
BeanDefinitionValidationException | in case of validation failure |
---|
Validate and prepare the given method override. Checks for existence of a method with the specified name, marking it as not overloaded if none found.
mo | the MethodOverride object to validate |
---|
BeanDefinitionValidationException | in case of validation failure |
---|