Springboot Expression
import
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
Parser
private static final ExpressionParser PARSER = new SpelExpressionParser();
Coding
String
Expression result = null;
return = PARSER.parseExpression("'String'");
System.out.println(result.getValue().toString());
0x0A
result = PARSER.parseExpression("0x0A");
System.out.println(result.getValue().toString());
1.2e+4
result = PARSER.parseExpression("1.2e+4");
System.out.println(result.getValue().toString());
substring
result = PARSER.parseExpression("'12345'.substring(2,3)");
System.out.println(result.getValue().toString());
== != > < >= <=
result = PARSER.parseExpression(<