SpEL
Spriing boot stater中根据配置文件中的条件 生成相应的bean, 以适应不同场景
@ConditionalOnExpression中使用SpEl, 支持各种条件表达式
String的各种方法都能用,不限于等于、正则、以..开始、以..结束
![](https://img2018.cnblogs.com/blog/1281466/201810/1281466-20181023124519542-670069536.png)
![](https://img2018.cnblogs.com/blog/1281466/201810/1281466-20181023124010914-2038321472.png)
自已如何用?
MethodBasedEvaluationContext context = new MethodBasedEvaluationContext(null, method, args, discoverer);
Object id = parser.parseExpression('#xxxxxxx.xxx').getValue(context);
参考
https://docs.spring.io/spring/docs/4.3.10.RELEASE/spring-framework-reference/html/expressions.html
@@@build beautiful things, share happiness@@@