public Object eval()

in src/main/java/org/apache/sling/scripting/sightly/impl/engine/SightlyScriptEngine.java [72:94]


    public Object eval(Reader reader, ScriptContext scriptContext) throws ScriptException {
        checkArguments(reader, scriptContext);
        try {
            SightlyCompiledScript compiledScript = null;
            Bindings bindings = scriptContext.getBindings(ScriptContext.ENGINE_SCOPE);
            if (bindings != null) {
                RenderUnit renderUnit = bundledUnitManager.getRenderUnit(bindings);
                if (renderUnit != null) {
                    compiledScript = new SightlyCompiledScript(this, renderUnit);
                }
            }
            if (compiledScript == null && slingHTLMasterCompiler != null) {
                compiledScript = slingHTLMasterCompiler.compileHTLScript(this, reader, scriptContext);
            }
            if (compiledScript != null) {
                return compiledScript.eval(scriptContext);
            }
        } catch (Exception e) {
            throw new ScriptException(e);
        }
        LOGGER.warn("Did not find a compilable or executable unit.");
        return null;
    }