Top Description Fields Constructors Methods
org.springframework.context.expression

public Class BeanFactoryResolver

extends Object
implements BeanResolver
Class Inheritance
All Implemented Interfaces
org.springframework.expression.BeanResolver
Imports
org.springframework.beans.BeansException, org.springframework.beans.factory.BeanFactory, org.springframework.expression.AccessException, .BeanResolver, .EvaluationContext, org.springframework.util.Assert

EL bean resolver that operates against a Spring org.springframework.beans.factory.BeanFactory.
Author
Juergen Hoeller
Since
3.0.4

Field Summary

Modifier and TypeField and Description
private final BeanFactory

Constructor Summary

AccessConstructor and Description
public
BeanFactoryResolver(BeanFactory
the BeanFactory to resolve bean names against
beanFactory
)

Create a new BeanFactoryResolver for the given factory.

Method Summary

Modifier and TypeMethod and Description
public Object
resolve(EvaluationContext
the current evaluation context
context
,
String
the name of the bean to look up
beanName
)

Implements org.springframework.expression.BeanResolver.resolve.

Look up a bean by the given name and return a corresponding instance for it.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanFactoryback to summary
private final BeanFactory beanFactory

Constructor Detail

BeanFactoryResolverback to summary
public BeanFactoryResolver(BeanFactory beanFactory)

Create a new BeanFactoryResolver for the given factory.

Parameters
beanFactory:BeanFactory

the BeanFactory to resolve bean names against

Method Detail

resolveback to summary
public Object resolve(EvaluationContext context, String beanName) throws AccessException

Implements org.springframework.expression.BeanResolver.resolve.

Doc from org.springframework.expression.BeanResolver.resolve.

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.

Parameters
context:EvaluationContext

the current evaluation context

beanName:String

the name of the bean to look up

Returns:Object

an object representing the bean

Annotations
@Override
Exceptions
AccessException:
if there is an unexpected problem resolving the bean