类 StandardBeanExpressionResolver
- java.lang.Object
- org.springframework.context.expression.StandardBeanExpressionResolver
- 所有已实现的接口:
BeanExpressionResolver
public class StandardBeanExpressionResolver extends Object implements BeanExpressionResolver
Standard implementation of theBeanExpressionResolver
interface, parsing and evaluating Spring EL using Spring's expression module.- 从以下版本开始:
- 3.0
- 作者:
- Juergen Hoeller
- 另请参阅:
ExpressionParser
,SpelExpressionParser
,StandardEvaluationContext
字段概要
字段 修饰符和类型 字段 说明 static String
DEFAULT_EXPRESSION_PREFIX
Default expression prefix: "#{"static String
DEFAULT_EXPRESSION_SUFFIX
Default expression suffix: "}"
构造器概要
构造器 构造器 说明 StandardBeanExpressionResolver()
Create a newStandardBeanExpressionResolver
with default settings.StandardBeanExpressionResolver(ClassLoader beanClassLoader)
Create a newStandardBeanExpressionResolver
with the given bean class loader, using it as the basis for expression compilation.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
customizeEvaluationContext(StandardEvaluationContext evalContext)
Template method for customizing the expression evaluation context.Object
evaluate(String value, BeanExpressionContext evalContext)
Evaluate the given value as an expression, if applicable; return the value as-is otherwise.void
setExpressionParser(ExpressionParser expressionParser)
Specify the EL parser to use for expression parsing.void
setExpressionPrefix(String expressionPrefix)
Set the prefix that an expression string starts with.void
setExpressionSuffix(String expressionSuffix)
Set the suffix that an expression string ends with.
DEFAULT_EXPRESSION_SUFFIX
public static final String DEFAULT_EXPRESSION_SUFFIX
Default expression suffix: "}"- 另请参阅:
- 常量字段值
构造器详细资料
StandardBeanExpressionResolver
public StandardBeanExpressionResolver()
Create a newStandardBeanExpressionResolver
with default settings.
StandardBeanExpressionResolver
public StandardBeanExpressionResolver(ClassLoader beanClassLoader)
Create a newStandardBeanExpressionResolver
with the given bean class loader, using it as the basis for expression compilation.- 参数:
beanClassLoader
- the factory's bean class loader
方法详细资料
setExpressionPrefix
public void setExpressionPrefix(String expressionPrefix)
Set the prefix that an expression string starts with. The default is "#{".
setExpressionSuffix
public void setExpressionSuffix(String expressionSuffix)
Set the suffix that an expression string ends with. The default is "}".
setExpressionParser
public void setExpressionParser(ExpressionParser expressionParser)
Specify the EL parser to use for expression parsing.Default is a
SpelExpressionParser
, compatible with standard Unified EL style expression syntax.
evaluate
public Object evaluate(String value, BeanExpressionContext evalContext) throws BeansException
从接口复制的说明:BeanExpressionResolver
Evaluate the given value as an expression, if applicable; return the value as-is otherwise.- 指定者:
evaluate
在接口中BeanExpressionResolver
- 参数:
value
- the value to checkevalContext
- the evaluation context- 返回:
- the resolved value (potentially the given value as-is)
- 抛出:
BeansException
- if evaluation failed
customizeEvaluationContext
protected void customizeEvaluationContext(StandardEvaluationContext evalContext)
Template method for customizing the expression evaluation context.The default implementation is empty.