JavaScriptInvoker { public <T> T eval(String script, Object... args){ return this.createScriptEnginer().eval(script, args); } JavaScriptInvoker(); ScriptEnginer createScriptEnginer(); JavaScriptInvoker whenError(Consumer<Throwable> errorHandler); T eval(String script, Object... args);  }
@Test public void testScript(){ UserEntity user = new UserEntity(); user.setId(2L); Object res = this.javaScriptInvoker.eval("user.id", "user", user); Assert.assertEquals(user.getId(), res); res = this.javaScriptInvoker.eval("user.id;true", "user", user); Assert.assertEquals(true, res); }