Introduce getName() in SpEL's BeanReference
Closes gh-32640
This commit is contained in:
parent
3f34a13436
commit
afbce96fb7
|
|
@ -32,6 +32,7 @@ import org.springframework.expression.spel.SpelMessage;
|
|||
* syntax {@code &orderServiceFactory} can be used to access the factory itself.
|
||||
*
|
||||
* @author Andy Clement
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
public class BeanReference extends SpelNodeImpl {
|
||||
|
||||
|
|
@ -46,6 +47,16 @@ public class BeanReference extends SpelNodeImpl {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the name of the referenced bean.
|
||||
* @return the name of the referenced bean, potentially prefixed with
|
||||
* {@code &} for a direct reference to a {@code FactoryBean}
|
||||
* @since 6.2
|
||||
*/
|
||||
public final String getName() {
|
||||
return this.beanName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
|
||||
BeanResolver beanResolver = state.getEvaluationContext().getBeanResolver();
|
||||
|
|
|
|||
Loading…
Reference in New Issue