package org.springframework.beans.factory.support;
Constant that indicates no autowiring at all.
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 determining an appropriate autowire strategy
through introspection of the bean class.
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 that indicates dependency checking for all properties
(object references as well as "simple" properties).
Create a new AbstractBeanDefinition with default settings.
Create a new AbstractBeanDefinition with the given
constructor argument values and property values.
Create a new AbstractBeanDefinition as deep copy of the given
bean definition.
Create a new AbstractBeanDefinition as deep copy of the given
bean definition.
- Parameters:
original the original bean definition to copy from
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).
- Will override beanClass if specified in the given bean definition.
- Will always take
abstract, scope,
lazyInit, autowireMode, dependencyCheck,
and dependsOn from the given bean definition.
- Will add
constructorArgumentValues, propertyValues,
methodOverrides from the given bean definition to existing ones.
- Will override
factoryBeanName, factoryMethodName,
initMethodName, and destroyMethodName if specified
in the given bean definition.
Apply the provided default values to this bean.
- Parameters:
defaults the defaults to apply
Return whether this definition specifies a bean class.
Specify the class for this bean.
Return the class of the wrapped bean, if already resolved.
- Returns:
- the bean class, or
null if none defined - Throws:
java.lang.IllegalStateException if the bean definition does not define a bean class,
or a specified bean class name has not been resolved into an actual Class
if (beanClassObject == null) { if (!(beanClassObject instanceof Class)) { "Bean class name [" + beanClassObject + "] has not been resolved into an actual Class");
return (Class) beanClassObject;
if (beanClassObject instanceof Class) { return (String) beanClassObject;
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.
- Parameters:
classLoader the ClassLoader to use for resolving a (potential) class name- Returns:
- the resolved bean class
- Throws:
java.lang.ClassNotFoundException if the class name could be resolved
Class resolvedClass = ClassUtils.forName(className, classLoader);
Set the name of the target scope for the bean.
Default is "singleton"; the out-of-the-box alternative is "prototype".
Extended bean factories might support further scopes.
Assert.notNull(scope, "Scope must not be null");
Return the name of the target scope for the bean.
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".
Return whether this a
Singleton, with a single shared instance
returned from all calls.
Return whether this a
Prototype, with an independent instance
returned for each call.
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.
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.
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.
Return whether this bean should be lazily initialized, i.e. not
eagerly instantiated on startup. Only applicable to a singleton 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.
Return the autowire mode as specified in the bean definition.
Return the resolved autowire code,
(resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE).
for (int i = 0; i < constructors.length; i++) { Set the dependency check code.
Return the dependency check code.
Set the names of the beans that this bean depends on being initialized.
The bean factory will guarantee that these beans get initialized before.
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.
Return the bean names that this bean depends on.
Set whether this bean is a candidate for getting autowired into some other bean.
Return whether this bean is a candidate for getting autowired into some other bean.
Register a qualifier to be used for autowire candidate resolution,
keyed by the qualifier's type name.
Return whether this bean has the specified qualifier.
Return the qualifier mapped to the provided type name.
Return all registered qualifiers.
Copy the qualifiers from the supplied AbstractBeanDefinition to this bean definition.
- Parameters:
source the AbstractBeanDefinition to copy from
Assert.notNull(source, "Source must not be null");
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.
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.
Specify constructor argument values for this bean.
Return constructor argument values for this bean (never
null).
Return if there are constructor argument values defined for this bean.
Specify property values for this bean, if any.
Return property values for this bean (never
null).
Specify method overrides for the bean, if any.
Return information about methods to be overridden by the IoC
container. This will be empty if there are no method overrides.
Never returns null.
Set the name of the initializer method. The default is
null
in which case there is no initializer method.
Return the name of the initializer method.
Specify whether or not the configured init method is the default.
Default value is
false.
Indicate whether the configured init method is the default.
Set the name of the destroy method. The default is
null
in which case there is no destroy method.
Return the name of the destroy method.
Specify whether or not the configured destroy method is the default.
Default value is
false.
Indicate whether the configured destroy method is the default.
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>).
Return whether this bean definition is 'synthetic', that is,
not defined by the application itself.
Set the role hint for this
BeanDefinition.
Return the role hint for this
BeanDefinition.
Set a human-readable description of this bean definition.
Set the resource that this bean definition came from
(for the purpose of showing context in case of errors).
Return the resource that this bean definition came from.
Set a description of the resource that this bean definition
came from (for the purpose of showing context in case of errors).
Set the originating (e.g. decorated) BeanDefinition, if any.
Validate this bean definition.
"Cannot combine static factory method with method overrides: " +
"the static factory method must create the instance");
Validate and prepare the method overrides defined for this bean.
Checks for existence of a method with the specified name.
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.
"Invalid method override: no method with name '" + mo.getMethodName() +
Clone this bean definition.
To be implemented by concrete subclasses.
- Returns:
- the cloned bean definition object
if (this.lazyInit != that.lazyInit) return false;
if (this.primary != that.primary) return false;
if (this.synthetic != that.synthetic) return false;
if (this.role != that.role) return false;
hashCode = 29 * hashCode + super.hashCode();