public class DefaultScriptBinding
extends groovy.lang.Binding
DefaultScriptBinding class represents a base class containing all
default variables to be used in a script. It may be extended by custom
variables or properties.
Furthermore, bindings inherited from this class enable the script to access a short API for several IQM commands and operator executions.
| Modifier and Type | Field and Description |
|---|---|
private static org.apache.log4j.Logger |
logger |
| Constructor and Description |
|---|
DefaultScriptBinding()
Creates a default binding object common to all scripts.
|
| Modifier and Type | Method and Description |
|---|---|
Process |
exec(String command)
Let the user execute a shell command in the current directory.
|
Process |
exec(String command,
File inDir)
Lets the user execute a shell command in a specified directory.
|
private void |
initStandardBinding()
This method initializes all standard variables via injection into the
Groovy binding.
|
void |
setEnvVar(String varName,
Object o)
Set a new variable to be available in the script API.
|
getProperty, getVariable, getVariables, hasVariable, setProperty, setVariablepublic DefaultScriptBinding()
private void initStandardBinding()
public void setEnvVar(String varName, Object o)
varName - the name of the variable (how it is accessed in the script)o - the value, i.e. the class or a concrete object/instancepublic Process exec(String command) throws IOException
command - ProcessIOExceptionpublic Process exec(String command, File inDir) throws IOException
command - inDir - ProcessIOExceptionCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.