public class ExpressionUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
execute(String exp,
Class<T> resultType,
boolean cached)
解析表达式并执行,然后返回指定类型结果
|
static <T> T |
execute(String exp,
org.springframework.expression.EvaluationContext context,
Class<T> resultType,
boolean cached)
解析表达式并在指定上下文中执行,然后返回指定类型结果
|
static org.springframework.expression.ExpressionParser |
getParser()
获取通用表达式解析器
|
static org.springframework.expression.Expression |
parseExp(String exp,
boolean cached)
解析表达式,并缓存表达式结果
|
static org.springframework.expression.EvaluationContext |
registerMethodArgs(Collection<String> paramNames,
Collection<Object> args,
org.springframework.expression.spel.support.StandardEvaluationContext context)
注册方法参数
|
public static org.springframework.expression.ExpressionParser getParser()
public static org.springframework.expression.Expression parseExp(@NonNull
String exp,
boolean cached)
exp - 表达式cached - 是否缓存表达式public static <T> T execute(String exp, Class<T> resultType, boolean cached)
exp - 表达式resultType - 返回值类cached - 是否缓存表达式public static <T> T execute(String exp, org.springframework.expression.EvaluationContext context, Class<T> resultType, boolean cached)
exp - 表达式context - 上下文resultType - 返回值类cached - 是否缓存表达式public static org.springframework.expression.EvaluationContext registerMethodArgs(@NonNull
Collection<String> paramNames,
@NonNull
Collection<Object> args,
org.springframework.expression.spel.support.StandardEvaluationContext context)
paramNames - 参数名args - 参数context - 上下文Copyright © 2022. All rights reserved.