Class BeanWiringInfo
- java.lang.Object
- org.springframework.beans.factory.wiring.BeanWiringInfo
public class BeanWiringInfo extends Object
Holder for bean wiring metadata information about a particular class. Used in conjunction with theConfigurable
annotation and the AspectJAnnotationBeanConfigurerAspect
.- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
BeanWiringInfoResolver
,AutowireCapableBeanFactory
,Configurable
Field Summary
Fields Modifier and Type Field Description static int
AUTOWIRE_BY_NAME
Constant that indicates autowiring bean properties by name.static int
AUTOWIRE_BY_TYPE
Constant that indicates autowiring bean properties by type.
Constructor Summary
Constructors Constructor Description BeanWiringInfo()
Create a default BeanWiringInfo that suggests plain initialization of factory and post-processor callbacks that the bean class may expect.BeanWiringInfo(int autowireMode, boolean dependencyCheck)
Create a new BeanWiringInfo that indicates autowiring.BeanWiringInfo(String beanName)
Create a new BeanWiringInfo that points to the given bean name.BeanWiringInfo(String beanName, boolean isDefaultBeanName)
Create a new BeanWiringInfo that points to the given bean name.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAutowireMode()
Return one of the constantsAUTOWIRE_BY_NAME
/AUTOWIRE_BY_TYPE
, if autowiring is indicated.String
getBeanName()
Return the specific bean name that this BeanWiringInfo points to, if any.boolean
getDependencyCheck()
Return whether to perform a dependency check for object references in the bean instance (after autowiring).boolean
indicatesAutowiring()
Return whether this BeanWiringInfo indicates autowiring.boolean
isDefaultBeanName()
Return whether the specific bean name is a suggested default bean name, not necessarily matching an actual bean definition in the factory.
Field Detail
AUTOWIRE_BY_NAME
public static final int AUTOWIRE_BY_NAME
Constant that indicates autowiring bean properties by name.
AUTOWIRE_BY_TYPE
public static final int AUTOWIRE_BY_TYPE
Constant that indicates autowiring bean properties by type.
Constructor Detail
BeanWiringInfo
public BeanWiringInfo()
Create a default BeanWiringInfo that suggests plain initialization of factory and post-processor callbacks that the bean class may expect.
BeanWiringInfo
public BeanWiringInfo(String beanName)
Create a new BeanWiringInfo that points to the given bean name.- Parameters:
beanName
- the name of the bean definition to take the property values from- Throws:
IllegalArgumentException
- if the supplied beanName isnull
, is empty, or consists wholly of whitespace
BeanWiringInfo
public BeanWiringInfo(String beanName, boolean isDefaultBeanName)
Create a new BeanWiringInfo that points to the given bean name.- Parameters:
beanName
- the name of the bean definition to take the property values fromisDefaultBeanName
- whether the given bean name is a suggested default bean name, not necessarily matching an actual bean definition- Throws:
IllegalArgumentException
- if the supplied beanName isnull
, is empty, or consists wholly of whitespace
BeanWiringInfo
public BeanWiringInfo(int autowireMode, boolean dependencyCheck)
Create a new BeanWiringInfo that indicates autowiring.- Parameters:
autowireMode
- one of the constantsAUTOWIRE_BY_NAME
/AUTOWIRE_BY_TYPE
dependencyCheck
- whether to perform a dependency check for object references in the bean instance (after autowiring)- Throws:
IllegalArgumentException
- if the suppliedautowireMode
is not one of the allowed values- See Also:
AUTOWIRE_BY_NAME
,AUTOWIRE_BY_TYPE
Method Detail
indicatesAutowiring
public boolean indicatesAutowiring()
Return whether this BeanWiringInfo indicates autowiring.
getBeanName
public String getBeanName()
Return the specific bean name that this BeanWiringInfo points to, if any.
isDefaultBeanName
public boolean isDefaultBeanName()
Return whether the specific bean name is a suggested default bean name, not necessarily matching an actual bean definition in the factory.
getAutowireMode
public int getAutowireMode()
Return one of the constantsAUTOWIRE_BY_NAME
/AUTOWIRE_BY_TYPE
, if autowiring is indicated.
getDependencyCheck
public boolean getDependencyCheck()
Return whether to perform a dependency check for object references in the bean instance (after autowiring).