26 Şubat 2018 Pazartesi

SpringExpressionLanguage SpelExpressionParser Sınıfı

constructor
Şöyle yaparız.
ExpressionParser parser = new SpelExpressionParser();
parseExpression metodu
Expression nesnesi döner. Şöyle yaparız.
String input = "A";
List<String> coreTeam = Arrays.asList("A","B","C","D","E");


StandardEvaluationContext coreTeamContext = new StandardEvaluationContext(coreTeam);
coreTeamContext.setVariable("CORE_TEAM",coreTeam);
coreTeamContext.setVariable("CHEK_TEAM",input);

Expression exp40 = parser.parseExpression("#CORE_TEAM.contains(#CHECK_TEAM)");
Boolean s = exp40.getValue(coreTeamContext,Boolean.class);

Hiç yorum yok:

Yorum Gönder