SimpleEvaluationContext是线程安全的吗?

时间:2018-10-01 17:40:18

标签: spring

根据Spring docs,有可能在程序中需要时使用 SimpleEvaluationContext

class Simple {
    public List<Boolean> booleanList = new ArrayList<Boolean>();
}

Simple simple = new Simple();
simple.booleanList.add(true);

EvaluationContext context = SimpleEvaluationContext().forReadOnlyDataBinding().build();

// false is passed in here as a string. SpEL and the conversion service
// correctly recognize that it needs to be a Boolean and convert it
parser.parseExpression("booleanList[0]").setValue(context, simple, "false");

// b is false
Boolean b = simple.booleanList.get(0);

我的问题是:此类( SimpleEvaluationContext )是线程安全的吗?

0 个答案:

没有答案