Class SecureGroovyCompiler

java.lang.Object
com.avoka.core.groovy.runtime.SecureGroovyCompiler

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

    • 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 Details

    • 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