Class BeanFactoryResolver
- java.lang.Object
- org.springframework.context.expression.BeanFactoryResolver
- All Implemented Interfaces:
BeanResolver
public class BeanFactoryResolver extends Object implements BeanResolver
EL bean resolver that operates against a SpringBeanFactory
.- Since:
- 3.0.4
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description BeanFactoryResolver(BeanFactory beanFactory)
Create a newBeanFactoryResolver
for the given factory.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
resolve(EvaluationContext context, String beanName)
Look up a bean by the given name and return a corresponding instance for it.
Constructor Detail
BeanFactoryResolver
public BeanFactoryResolver(BeanFactory beanFactory)
Create a newBeanFactoryResolver
for the given factory.- Parameters:
beanFactory
- theBeanFactory
to resolve bean names against
Method Detail
resolve
public Object resolve(EvaluationContext context, String beanName) throws AccessException
Description copied from interface:BeanResolver
Look up a bean by the given name and return a corresponding instance for it. For attempting access to a factory bean, the name needs a & prefix.- Specified by:
resolve
in interfaceBeanResolver
- Parameters:
context
- the current evaluation contextbeanName
- the name of the bean to look up- Returns:
- an object representing the bean
- Throws:
AccessException
- if there is an unexpected problem resolving the bean