How to add an object without a constructor to a list using Spring Expression Language
问题 I want to add a BigDecimal to a list using Spring Expression Language. public class SpelTest { public List<BigDecimal> values; StandardEvaluationContext context; SpelExpressionParser parser; @Before public void setup() { values = new ArrayList<>(); context = new StandardEvaluationContext(this); parser = new SpelExpressionParser(new SpelParserConfiguration(true, true)); } @Test public void shouldChangeValue() { values.add(BigDecimal.ONE); parser.parseExpression("values[0]").setValue(context,