public class AnnotationBeanWiringInfoResolver extends Object implements BeanWiringInfoResolver
BeanWiringInfoResolver
that
uses the Configurable annotation to identify which classes need autowiring.
The bean name to look up will be taken from the Configurable
annotation
if specified; otherwise the default will be the fully-qualified name of the
class being configured.Configurable
,
ClassNameBeanWiringInfoResolver
Constructor and Description |
---|
AnnotationBeanWiringInfoResolver() |
Modifier and Type | Method and Description |
---|---|
protected BeanWiringInfo |
buildWiringInfo(Object beanInstance,
Configurable annotation)
Build the BeanWiringInfo for the given Configurable annotation.
|
protected String |
getDefaultBeanName(Object beanInstance)
Determine the default bean name for the specified bean instance.
|
BeanWiringInfo |
resolveWiringInfo(Object beanInstance)
Resolve the BeanWiringInfo for the given bean instance.
|
public BeanWiringInfo resolveWiringInfo(Object beanInstance)
BeanWiringInfoResolver
resolveWiringInfo
in interface BeanWiringInfoResolver
beanInstance
- the bean instance to resolve info fornull
if not foundprotected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation)
beanInstance
- the bean instanceannotation
- the Configurable annotation found on the bean classprotected String getDefaultBeanName(Object beanInstance)
The default implementation returns the superclass name for a CGLIB proxy and the name of the plain bean class else.
beanInstance
- the bean instance to build a default name forClassUtils.getUserClass(Class)