Class SecureGroovyCompiler


  • public class SecureGroovyCompiler
    extends Object
    Provides a Secure Groovy Compiler.
    Since:
    17.10.0
    • Constructor Detail

      • SecureGroovyCompiler

        public SecureGroovyCompiler​(String script,
                                    ClassLoader classLoader,
                                    SecureCompilerConfiguration compilerConfig,
                                    boolean cacheClassLoader)
        Create secure groovy compiler.
        Parameters:
        script - the groovy script (required)
        classLoader - the classloader (required)
        compilerConfig - the compiler config (required)
        cacheClassLoader - specify whether to cache the class loader
      • SecureGroovyCompiler

        public SecureGroovyCompiler​(String script,
                                    ClassLoader classLoader,
                                    SecureCompilerConfiguration compilerConfig)
        Create secure groovy compiler.
        Parameters:
        script - the groovy script (required)
        classLoader - the classloader (required)
        compilerConfig - the compiler config (required)
    • Method Detail

      • hasPackageDeclarations

        public static boolean hasPackageDeclarations​(String script)
        Return true if the script has multiple package declarations.
        Parameters:
        script - the groovy script to check
        Returns:
        true if the script has multiple package declarations
      • getScriptClass

        public Class getScriptClass()
        Returns:
        the script class