Code example for Compilable

Methods: compile

0
            if (engine == null) {
                throw new IllegalArgumentException("The script type is not supported for language: " + language);
            } 
            try { 
                Compilable compilableEngine = (Compilable) engine;
                compiledScript = compilableEngine.compile(script);
                if (Debug.verboseOn()) {
                    Debug.logVerbose("Compiled script [" + script + "] using engine " + engine.getClass().getName(), module);
                } 
            } catch (ClassCastException e) {
                if (Debug.verboseOn()) {
                    Debug.logVerbose("Script engine " + engine.getClass().getName() + " does not implement Compilable", module);
                } 
            } 
            if (compiledScript != null) {
                parsedScripts.putIfAbsent(cacheKey, compiledScript);
            } 
        } 
        return compiledScript;
    }