Introduce getName() in SpEL's BeanReference
Closes gh-32640
This commit is contained in:
@@ -32,6 +32,7 @@ import org.springframework.expression.spel.SpelMessage;
|
|||||||
* syntax {@code &orderServiceFactory} can be used to access the factory itself.
|
* syntax {@code &orderServiceFactory} can be used to access the factory itself.
|
||||||
*
|
*
|
||||||
* @author Andy Clement
|
* @author Andy Clement
|
||||||
|
* @author Sam Brannen
|
||||||
*/
|
*/
|
||||||
public class BeanReference extends SpelNodeImpl {
|
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
|
@Override
|
||||||
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
|
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
|
||||||
BeanResolver beanResolver = state.getEvaluationContext().getBeanResolver();
|
BeanResolver beanResolver = state.getEvaluationContext().getBeanResolver();
|
||||||
|
|||||||
Reference in New Issue
Block a user