Class GroovyScripting


  • public class GroovyScripting
    extends Object
    For Groovy we are not using the javax.script API because we need more control over debug mode and script class loader. Groovy scritps will be processed by this class
    Author:
    Bogdan Stefanescu
    • Field Detail

      • loader

        protected final groovy.lang.GroovyClassLoader loader
      • cache

        protected Map<File,​org.nuxeo.ecm.webengine.scripting.GroovyScripting.Entry> cache
    • Constructor Detail

      • GroovyScripting

        public GroovyScripting​(ClassLoader parent)
      • GroovyScripting

        public GroovyScripting​(ClassLoader parent,
                               org.codehaus.groovy.control.CompilerConfiguration cfg)
    • Method Detail

      • addClasspath

        public void addClasspath​(String cp)
      • addClasspathUrl

        public void addClasspathUrl​(URL cp)
      • clearCache

        public void clearCache()
      • getGroovyClassLoader

        public groovy.lang.GroovyClassLoader getGroovyClassLoader()
      • eval

        public Object eval​(File file,
                           Map<String,​Object> context)
                    throws groovy.lang.GroovyRuntimeException
        Throws:
        groovy.lang.GroovyRuntimeException
      • eval

        public Object eval​(File file,
                           groovy.lang.Binding context)
                    throws groovy.lang.GroovyRuntimeException
        Throws:
        groovy.lang.GroovyRuntimeException
      • compile

        public Class<?> compile​(File file)
                         throws groovy.lang.GroovyRuntimeException
        Throws:
        groovy.lang.GroovyRuntimeException
      • getScript

        public groovy.lang.Script getScript​(File file,
                                            groovy.lang.Binding context)
                                     throws groovy.lang.GroovyRuntimeException
        Throws:
        groovy.lang.GroovyRuntimeException