org.apache.maven.shared.scriptinterpreter
Class GroovyScriptInterpreter

java.lang.Object
  extended by org.apache.maven.shared.scriptinterpreter.GroovyScriptInterpreter
All Implemented Interfaces:
ScriptInterpreter

@Component(role=ScriptInterpreter.class,
           hint="groovy")
public class GroovyScriptInterpreter
extends Object
implements ScriptInterpreter

Provides a facade to evaluate Groovy scripts.

Version:
$Id: GroovyScriptInterpreter.java 1361828 2012-07-15 22:30:27Z hboutemy $
Author:
Benjamin Bentmann

Constructor Summary
GroovyScriptInterpreter()
           
 
Method Summary
 Object evaluateScript(String script, List<String> classPath, Map<String,? extends Object> globalVariables, PrintStream scriptOutput)
          Evaluates the specified script.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyScriptInterpreter

public GroovyScriptInterpreter()
Method Detail

evaluateScript

public Object evaluateScript(String script,
                             List<String> classPath,
                             Map<String,? extends Object> globalVariables,
                             PrintStream scriptOutput)
                      throws ScriptEvaluationException
Evaluates the specified script.

Specified by:
evaluateScript in interface ScriptInterpreter
Parameters:
script - The script contents to evalute, must not be null.
classPath - The additional class path for the script interpreter, may be null or empty if only the plugin realm should be used for the script evaluation. If specified, this class path will precede the artifacts from the plugin class path.
globalVariables - The global variables (as a mapping from variable name to value) to define for the script, may be null if not used.
scriptOutput - A print stream to redirect any output from the script to, may be null to use stdout/stderr.
Returns:
The return value from the script, can be null
Throws:
ScriptEvaluationException - If the script evaluation produced an error.


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.