Code example for SimpleBindings

0
	} 
 
	@Override 
	public Object evaluate(ScriptSource script, Map<String, Object> arguments) {
		ScriptEngine engine = getScriptEngine(script);
		Bindings bindings = (!CollectionUtils.isEmpty(arguments) ? new SimpleBindings(arguments) : null);
		try { 
			return (bindings != null ? engine.eval(script.getScriptAsString(), bindings) :
					engine.eval(script.getScriptAsString()));
		} 
		catch (IOException ex) {
			throw new ScriptCompilationException(script, "Cannot access script", ex);
		} 
		catch (ScriptException ex) {
			throw new ScriptCompilationException(script, "Evaluation failure", ex);
		} 
	} 
 
	/** 
	 * Obtain the JSR-223 ScriptEngine to use for the given script. 
Connect your IDE to all the code out there  Get Codota for Java