public class Groovy extends Object implements Serializable, RevisionHandler
Modifier and Type | Field and Description |
---|---|
static String |
CLASS_GROOVYCLASSLOADER
the classname of the Groovy classloader.
|
Constructor and Description |
---|
Groovy()
default constructor, tries to instantiate a Groovy classloader.
|
Modifier and Type | Method and Description |
---|---|
Object |
getClassLoader()
returns the currently used Groovy classloader.
|
String |
getRevision()
Returns the revision string.
|
static Object |
invoke(Object o,
String methodName,
Class<?>[] paramClasses,
Object[] paramValues)
executes the specified method and returns the result, if any.
|
Object |
invoke(String methodName,
Class<?>[] paramClasses,
Object[] paramValues)
executes the specified method on the current interpreter and returns the
result, if any.
|
static boolean |
isPresent()
returns whether the Groovy classes are present or not, i.e.
|
static void |
main(String[] args)
If no arguments are given, it just prints the presence of the Groovy
classes, otherwise it expects a Groovy filename to execute.
|
static Object |
newClassLoader()
initializes and returns a Groovy Interpreter.
|
static Object |
newInstance(File file,
Class<?> template)
loads the module and returns a new instance of it as instance of the
provided Java class template.
|
public static final String CLASS_GROOVYCLASSLOADER
public Groovy()
public Object getClassLoader()
public Object invoke(String methodName, Class<?>[] paramClasses, Object[] paramValues)
methodName
- the name of the methodparamClasses
- the classes of the parametersparamValues
- the values of the parameterspublic static boolean isPresent()
public static Object newClassLoader()
public static Object newInstance(File file, Class<?> template)
file
- the Groovy module filetemplate
- the template for the returned Java objectpublic static Object invoke(Object o, String methodName, Class<?>[] paramClasses, Object[] paramValues)
o
- the object the method should be called from, e.g., a Groovy
InterpretermethodName
- the name of the methodparamClasses
- the classes of the parametersparamValues
- the values of the parameterspublic String getRevision()
getRevision
in interface RevisionHandler
public static void main(String[] args)
args
- commandline argumentsCopyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.