org.springframework.beans.factory.support
Class AbstractBeanDefinition

java.lang.Object
  extended byorg.springframework.beans.factory.support.AbstractBeanDefinition
All Implemented Interfaces:
BeanDefinition
Direct Known Subclasses:
ChildBeanDefinition, RootBeanDefinition

public abstract class AbstractBeanDefinition
extends java.lang.Object
implements BeanDefinition

Common base class for bean definitions, factoring out common functionality from RootBeanDefinition and ChildBeanDefinition.

Version:
$Id: AbstractBeanDefinition.java,v 1.12 2004/03/19 17:45:36 jhoeller Exp $
Author:
Rod Johnson, Juergen Hoeller
See Also:
RootBeanDefinition, ChildBeanDefinition

Constructor Summary
protected AbstractBeanDefinition(MutablePropertyValues pvs)
          Create a new bean definition.
 
Method Summary
 ConstructorArgumentValues getConstructorArgumentValues()
          This implementations returns null: Just RootBeanDefinitions have concrete support for constructor argument values.
 MutablePropertyValues getPropertyValues()
          Return the PropertyValues to be applied to a new instance of the bean.
 java.lang.String getResourceDescription()
          Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
 boolean isLazyInit()
          Return whether this bean should be lazily initialized.
 boolean isSingleton()
          Return whether this a Singleton, with a single, shared instance returned on all calls,
 void setLazyInit(boolean lazyInit)
          Set whether this bean should be lazily initialized.
 void setResourceDescription(java.lang.String resourceDescription)
          Set a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
 void setSingleton(boolean singleton)
          Set if this a Singleton, with a single, shared instance returned on all calls.
 void validate()
          Validate this bean definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBeanDefinition

protected AbstractBeanDefinition(MutablePropertyValues pvs)
Create a new bean definition.

Parameters:
pvs - the PropertyValues to be applied to a new instance of the bean
Method Detail

getPropertyValues

public MutablePropertyValues getPropertyValues()
Description copied from interface: BeanDefinition
Return the PropertyValues to be applied to a new instance of the bean.

Specified by:
getPropertyValues in interface BeanDefinition

getConstructorArgumentValues

public ConstructorArgumentValues getConstructorArgumentValues()
This implementations returns null: Just RootBeanDefinitions have concrete support for constructor argument values.

Specified by:
getConstructorArgumentValues in interface BeanDefinition

setResourceDescription

public void setResourceDescription(java.lang.String resourceDescription)
Set a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).


getResourceDescription

public java.lang.String getResourceDescription()
Description copied from interface: BeanDefinition
Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).

Specified by:
getResourceDescription in interface BeanDefinition

setSingleton

public void setSingleton(boolean singleton)
Set if this a Singleton, with a single, shared instance returned on all calls. If false, the BeanFactory will apply the Prototype design pattern, with each caller requesting an instance getting an independent instance. How this is defined will depend on the BeanFactory. "Singletons" are the commoner type.


isSingleton

public boolean isSingleton()
Return whether this a Singleton, with a single, shared instance returned on all calls,


setLazyInit

public void setLazyInit(boolean lazyInit)
Set whether this bean should be lazily initialized. Only applicable to a singleton bean. If false, it will get instantiated on startup by bean factories that perform eager initialization of singletons.


isLazyInit

public boolean isLazyInit()
Return whether this bean should be lazily initialized.


validate

public void validate()
              throws BeanDefinitionValidationException
Validate this bean definition.

Throws:
BeanDefinitionValidationException - in case of validation failure


Copyright (C) 2003-2004 The Spring Framework Project.