Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » beans » factory » support » [javadoc | source]
org.springframework.beans.factory.support
abstract public class: AbstractBeanDefinition [javadoc | source]
java.lang.Object
   org.springframework.core.AttributeAccessorSupport
      org.springframework.beans.BeanMetadataAttributeAccessor
         org.springframework.beans.factory.support.AbstractBeanDefinition

All Implemented Interfaces:
    Cloneable, BeanDefinition, BeanMetadataElement, AttributeAccessor, Serializable

Direct Known Subclasses:
    AnnotatedGenericBeanDefinition, ChildBeanDefinition, ScannedGenericBeanDefinition, RootBeanDefinition, GenericBeanDefinition

Base class for concrete, full-fledged org.springframework.beans.factory.config.BeanDefinition classes, factoring out common properties of RootBeanDefinition and ChildBeanDefinition .

The autowire constants match the ones defined in the org.springframework.beans.factory.config.AutowireCapableBeanFactory interface.

Field Summary
public static final  int AUTOWIRE_NO    Constant that indicates no autowiring at all. 
public static final  int AUTOWIRE_BY_NAME    Constant that indicates autowiring bean properties by name. 
public static final  int AUTOWIRE_BY_TYPE    Constant that indicates autowiring bean properties by type. 
public static final  int AUTOWIRE_CONSTRUCTOR    Constant that indicates autowiring a constructor. 
public static final  int AUTOWIRE_AUTODETECT    Constant that indicates determining an appropriate autowire strategy through introspection of the bean class. 
public static final  int DEPENDENCY_CHECK_NONE    Constant that indicates no dependency check at all. 
public static final  int DEPENDENCY_CHECK_OBJECTS    Constant that indicates dependency checking for object references. 
public static final  int DEPENDENCY_CHECK_SIMPLE    Constant that indicates dependency checking for "simple" properties. 
public static final  int DEPENDENCY_CHECK_ALL    Constant that indicates dependency checking for all properties (object references as well as "simple" properties). 
Constructor:
 protected AbstractBeanDefinition() 
 protected AbstractBeanDefinition(AbstractBeanDefinition original) 
    Create a new AbstractBeanDefinition as deep copy of the given bean definition.
    Parameters:
    original - the original bean definition to copy from
 protected AbstractBeanDefinition(BeanDefinition original) 
    Create a new AbstractBeanDefinition as deep copy of the given bean definition.
    Parameters:
    original - the original bean definition to copy from
 protected AbstractBeanDefinition(ConstructorArgumentValues cargs,
    MutablePropertyValues pvs) 
    Create a new AbstractBeanDefinition with the given constructor argument values and property values.
Method from org.springframework.beans.factory.support.AbstractBeanDefinition Summary:
addQualifier,   applyDefaults,   clone,   cloneBeanDefinition,   copyQualifiersFrom,   equals,   getAutowireMode,   getBeanClass,   getBeanClassName,   getConstructorArgumentValues,   getDependencyCheck,   getDependsOn,   getDescription,   getDestroyMethodName,   getFactoryBeanName,   getFactoryMethodName,   getInitMethodName,   getMethodOverrides,   getOriginatingBeanDefinition,   getPropertyValues,   getQualifier,   getQualifiers,   getResolvedAutowireMode,   getResource,   getResourceDescription,   getRole,   getScope,   hasBeanClass,   hasConstructorArgumentValues,   hasQualifier,   hashCode,   isAbstract,   isAutowireCandidate,   isEnforceDestroyMethod,   isEnforceInitMethod,   isLazyInit,   isPrimary,   isPrototype,   isSingleton,   isSynthetic,   overrideFrom,   overrideFrom,   prepareMethodOverride,   prepareMethodOverrides,   resolveBeanClass,   setAbstract,   setAutowireCandidate,   setAutowireMode,   setBeanClass,   setBeanClassName,   setConstructorArgumentValues,   setDependencyCheck,   setDependsOn,   setDescription,   setDestroyMethodName,   setEnforceDestroyMethod,   setEnforceInitMethod,   setFactoryBeanName,   setFactoryMethodName,   setInitMethodName,   setLazyInit,   setMethodOverrides,   setOriginatingBeanDefinition,   setPrimary,   setPropertyValues,   setResource,   setResourceDescription,   setRole,   setScope,   setSingleton,   setSynthetic,   toString,   validate
Methods from org.springframework.beans.BeanMetadataAttributeAccessor:
addMetadataAttribute,   getAttribute,   getMetadataAttribute,   getSource,   removeAttribute,   setAttribute,   setSource
Methods from org.springframework.core.AttributeAccessorSupport:
attributeNames,   copyAttributesFrom,   equals,   getAttribute,   hasAttribute,   hashCode,   removeAttribute,   setAttribute
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.beans.factory.support.AbstractBeanDefinition Detail:
 public  void addQualifier(AutowireCandidateQualifier qualifier) 
    Register a qualifier to be used for autowire candidate resolution, keyed by the qualifier's type name.
 public  void applyDefaults(BeanDefinitionDefaults defaults) 
    Apply the provided default values to this bean.
 public Object clone() 
 abstract public AbstractBeanDefinition cloneBeanDefinition()
    Clone this bean definition. To be implemented by concrete subclasses.
 protected  void copyQualifiersFrom(AbstractBeanDefinition source) 
    Copy the qualifiers from the supplied AbstractBeanDefinition to this bean definition.
 public boolean equals(Object other) 
 public int getAutowireMode() 
    Return the autowire mode as specified in the bean definition.
 public Class getBeanClass() throws IllegalStateException 
    Return the class of the wrapped bean, if already resolved.
 public String getBeanClassName() 
 public ConstructorArgumentValues getConstructorArgumentValues() 
    Return constructor argument values for this bean (never null).
 public int getDependencyCheck() 
    Return the dependency check code.
 public String[] getDependsOn() 
    Return the bean names that this bean depends on.
 public String getDescription() 
 public String getDestroyMethodName() 
    Return the name of the destroy method.
 public String getFactoryBeanName() 
 public String getFactoryMethodName() 
 public String getInitMethodName() 
    Return the name of the initializer method.
 public MethodOverrides getMethodOverrides() 
    Return information about methods to be overridden by the IoC container. This will be empty if there are no method overrides. Never returns null.
 public BeanDefinition getOriginatingBeanDefinition() 
 public MutablePropertyValues getPropertyValues() 
    Return property values for this bean (never null).
 public AutowireCandidateQualifier getQualifier(String typeName) 
    Return the qualifier mapped to the provided type name.
 public Set getQualifiers() 
    Return all registered qualifiers.
 public int getResolvedAutowireMode() 
    Return the resolved autowire code, (resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE).
 public Resource getResource() 
    Return the resource that this bean definition came from.
 public String getResourceDescription() 
 public int getRole() 
    Return the role hint for this BeanDefinition.
 public String getScope() 
    Return the name of the target scope for the bean.
 public boolean hasBeanClass() 
    Return whether this definition specifies a bean class.
 public boolean hasConstructorArgumentValues() 
    Return if there are constructor argument values defined for this bean.
 public boolean hasQualifier(String typeName) 
    Return whether this bean has the specified qualifier.
 public int hashCode() 
 public boolean isAbstract() 
    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.
 public boolean isAutowireCandidate() 
    Return whether this bean is a candidate for getting autowired into some other bean.
 public boolean isEnforceDestroyMethod() 
    Indicate whether the configured destroy method is the default.
 public boolean isEnforceInitMethod() 
    Indicate whether the configured init method is the default.
 public boolean isLazyInit() 
    Return whether this bean should be lazily initialized, i.e. not eagerly instantiated on startup. Only applicable to a singleton bean.
 public boolean isPrimary() 
    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.
 public boolean isPrototype() 
    Return whether this a Prototype, with an independent instance returned for each call.
 public boolean isSingleton() 
    Return whether this a Singleton, with a single shared instance returned from all calls.
 public boolean isSynthetic() 
    Return whether this bean definition is 'synthetic', that is, not defined by the application itself.
 public  void overrideFrom(AbstractBeanDefinition other) 
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).
 public  void overrideFrom(BeanDefinition other) 
    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.
 protected  void prepareMethodOverride(MethodOverride mo) throws BeanDefinitionValidationException 
    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.
 public  void prepareMethodOverrides() throws BeanDefinitionValidationException 
    Validate and prepare the method overrides defined for this bean. Checks for existence of a method with the specified name.
 public Class resolveBeanClass(ClassLoader classLoader) throws ClassNotFoundException 
    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.
 public  void setAbstract(boolean abstractFlag) 
    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.

 public  void setAutowireCandidate(boolean autowireCandidate) 
    Set whether this bean is a candidate for getting autowired into some other bean.
 public  void setAutowireMode(int autowireMode) 
    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.
 public  void setBeanClass(Class beanClass) 
    Specify the class for this bean.
 public  void setBeanClassName(String beanClassName) 
 public  void setConstructorArgumentValues(ConstructorArgumentValues constructorArgumentValues) 
    Specify constructor argument values for this bean.
 public  void setDependencyCheck(int dependencyCheck) 
    Set the dependency check code.
 public  void setDependsOn(String[] dependsOn) 
    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.

 public  void setDescription(String description) 
    Set a human-readable description of this bean definition.
 public  void setDestroyMethodName(String destroyMethodName) 
    Set the name of the destroy method. The default is null in which case there is no destroy method.
 public  void setEnforceDestroyMethod(boolean enforceDestroyMethod) 
    Specify whether or not the configured destroy method is the default. Default value is false.
 public  void setEnforceInitMethod(boolean enforceInitMethod) 
    Specify whether or not the configured init method is the default. Default value is false.
 public  void setFactoryBeanName(String factoryBeanName) 
 public  void setFactoryMethodName(String factoryMethodName) 
 public  void setInitMethodName(String initMethodName) 
    Set the name of the initializer method. The default is null in which case there is no initializer method.
 public  void setLazyInit(boolean lazyInit) 
    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.

 public  void setMethodOverrides(MethodOverrides methodOverrides) 
    Specify method overrides for the bean, if any.
 public  void setOriginatingBeanDefinition(BeanDefinition originatingBd) 
    Set the originating (e.g. decorated) BeanDefinition, if any.
 public  void setPrimary(boolean primary) 
    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.
 public  void setPropertyValues(MutablePropertyValues propertyValues) 
    Specify property values for this bean, if any.
 public  void setResource(Resource resource) 
    Set the resource that this bean definition came from (for the purpose of showing context in case of errors).
 public  void setResourceDescription(String resourceDescription) 
    Set a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
 public  void setRole(int role) 
    Set the role hint for this BeanDefinition.
 public  void setScope(String scope) 
    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.

 public  void setSingleton(boolean singleton) 
Deprecated! since - Spring 2.5, in favor of #setScope

    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".

 public  void setSynthetic(boolean synthetic) 
    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>).
 public String toString() 
 public  void validate() throws BeanDefinitionValidationException 
    Validate this bean definition.