[Java] Interface GroovyRunner

Classes which can run scripts should implement this interface.

Since:
2.5.0

Methods Summary

Methods
Type Params Return Type Name and description
boolean canRun(Class<?> scriptClass, GroovyClassLoader loader)
Returns true if this runner is able to run the given class.
Object run(Class<?> scriptClass, GroovyClassLoader loader)
Runs the given class.

Method Detail

public boolean canRun(Class<?> scriptClass, GroovyClassLoader loader)

Returns true if this runner is able to run the given class.

Parameters:
scriptClass - class to run
loader - used to locate classes and resources
Returns:
true if given class can be run, else false

public Object run(Class<?> scriptClass, GroovyClassLoader loader)

Runs the given class.

Parameters:
scriptClass - class to run
loader - used to locate classes and resources
Returns:
result of running the class

© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.5.14/html/gapi/org/apache/groovy/plugin/GroovyRunner.html