StandardEvaluationContext用法

List primes = new ArrayList();
primes.addAll(Arrays.asList(2,3,5,7,11,13,17));
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext context = new StandardEvaluationContext();
context.setVariable("primes",primes);
List primesGreaterThanTen = (List) parser.parseExpression("#primes.?[#this>10]").getValue(context);

你可能感兴趣的:(StandardEvaluationContext用法)