public class GenericBeanFactoryAccessor extends Object
A fork of the Spring 2.5.6 GenericBeanFactoryAccess class that was removed from Spring 3.0.
Constructor and description |
---|
GenericBeanFactoryAccessor(ListableBeanFactory beanFactory) Constructs a GenericBeanFactoryAccessor that wraps the supplied ListableBeanFactory. |
Type Params | Return Type | Name and description |
---|---|---|
<A extends Annotation> |
public A |
findAnnotationOnBean(String beanName, Class<A> annotationType) Find a Annotation of annotationType on the specified
bean, traversing its interfaces and super classes if no annotation can be
found on the given class itself, as well as checking its raw bean class
if not found on the exposed bean reference (e.g. in case of a proxy). |
<T> |
public T |
getBean(String name)
|
<T> |
public T |
getBean(String name, Class<T> requiredType)
|
|
public final ListableBeanFactory |
getBeanFactory() Return the wrapped ListableBeanFactory. |
<T> |
public Map<String, T> |
getBeansOfType(Class<T> type)
|
<T> |
public Map<String, T> |
getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
|
|
public Map<String, Object> |
getBeansWithAnnotation(Class<? extends Annotation> annotationType) Find all beans whose Class has the supplied Annotation type. |
Constructs a GenericBeanFactoryAccessor
that wraps the supplied ListableBeanFactory.
Find a Annotation of annotationType
on the specified
bean, traversing its interfaces and super classes if no annotation can be
found on the given class itself, as well as checking its raw bean class
if not found on the exposed bean reference (e.g. in case of a proxy).
beanName
- the name of the bean to look for annotations onannotationType
- the annotation class to look fornull
Return the wrapped ListableBeanFactory.
Find all beans whose Class
has the supplied Annotation type.
annotationType
- the type of annotation to look for