public final class AutowiredBean extends Object
Modifier and Type | Method and Description |
---|---|
static org.springframework.beans.factory.support.GenericBeanDefinition |
createAutowiredBean(Class<?>... autowiredTypes)
Creates an autowired dependency on the given
autowiredTypes . |
static org.springframework.beans.factory.support.GenericBeanDefinition |
createAutowiredBeanWithFallback(Object fallback,
Class<?>... autowiredTypes)
Creates an autowired dependency on the given
autowiredTypes . |
public static org.springframework.beans.factory.support.GenericBeanDefinition createAutowiredBean(Class<?>... autowiredTypes)
autowiredTypes
. A lookup is done on the first type,
if no beans of that type are found, the next is evaluated, and so on. If more than one bean of any type is found
when it is evaluated, an exception is thrown.
Beans that are not eligible for autowiring (as defined in Spring configuration) are ignored altogether.autowiredTypes
- The types of bean to autowire.public static org.springframework.beans.factory.support.GenericBeanDefinition createAutowiredBeanWithFallback(Object fallback, Class<?>... autowiredTypes)
autowiredTypes
. A lookup is done on the first type,
if no beans of that type are found, the next is evaluated, and so on. If more than one bean of any type is found
when it is evaluated, an exception is thrown.
If there are no autowire candidates, the given fallback
is used to take its place. If
fallback
is null
, an exception will be thrown.
Beans that are not eligible for autowiring (as defined in Spring configuration) are ignored altogether.fallback
- The bean to select when no autowired dependencies can be foundautowiredTypes
- The types of bean to autowire.Copyright © 2010-2014. All Rights Reserved.