|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--groovy.lang.GroovyObjectSupport | +--groovy.lang.GroovyShell
Represents a groovy shell capable of running arbitrary groovy scripts
Field Summary | |
static String[] |
EMPTY_ARGS
|
Constructor Summary | |
GroovyShell()
|
|
GroovyShell(ClassLoader parent,
groovy.lang.ScriptContext binding)
|
|
GroovyShell(groovy.lang.ScriptContext binding)
|
Method Summary | |
Object |
evaluate(InputStream in,
String fileName)
Evaluates some script against the current ScriptContext and returns the result |
Object |
evaluate(String fileName)
Evaluates some script against the current ScriptContext and returns the result |
Object |
evaluate(String scriptText,
String fileName)
Evaluates some script against the current ScriptContext and returns the result |
groovy.lang.ScriptContext |
getContext()
|
Object |
getProperty(String property)
|
Object |
getVariable(String name)
|
static void |
main(String[] args)
|
void |
run(File scriptFile,
List list)
A helper method which runs the given script file with the given command line arguments |
Object |
run(InputStream in,
String fileName,
String[] args)
Runs the given script with command line arguments |
void |
run(String scriptFile,
String[] args)
Runs the given script file name with the given command line arguments |
void |
run(String scriptText,
String fileName,
String[] args)
Runs the given script text with command line arguments |
void |
setProperty(String property,
Object newValue)
Sets the given property to the new value |
void |
setVariable(String name,
Object value)
|
Methods inherited from class groovy.lang.GroovyObjectSupport |
getMetaClass, invokeMethod, setMetaClass |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String[] EMPTY_ARGS
Constructor Detail |
public GroovyShell()
public GroovyShell(groovy.lang.ScriptContext binding)
public GroovyShell(ClassLoader parent, groovy.lang.ScriptContext binding)
Method Detail |
public static void main(String[] args)
public groovy.lang.ScriptContext getContext()
public Object getProperty(String property)
getProperty
in interface GroovyObject
getProperty
in class GroovyObjectSupport
public void setProperty(String property, Object newValue)
GroovyObject
setProperty
in interface GroovyObject
setProperty
in class GroovyObjectSupport
public void run(File scriptFile, List list) throws ClassNotFoundException, SyntaxException, IOException
scriptFile
- the file of the script to run
ClassNotFoundException
SyntaxException
IOException
public void run(String scriptFile, String[] args) throws ClassNotFoundException, SyntaxException, IOException
scriptFile
- the file name of the script to runargs
- the command line arguments to pass in
ClassNotFoundException
SyntaxException
IOException
public void run(String scriptText, String fileName, String[] args) throws ClassNotFoundException, SyntaxException, IOException
scriptText
- is the text content of the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)args
- the command line arguments to pass in
ClassNotFoundException
SyntaxException
IOException
public Object run(InputStream in, String fileName, String[] args) throws ClassNotFoundException, SyntaxException, IOException
in
- the stream reading the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)args
- the command line arguments to pass in
ClassNotFoundException
SyntaxException
IOException
public Object getVariable(String name)
public void setVariable(String name, Object value)
public Object evaluate(String scriptText, String fileName) throws SyntaxException, ClassNotFoundException, IOException
fileName
- is the logical file name of the script (which is used to create the class name of the script)
SyntaxException
ClassNotFoundException
IOException
public Object evaluate(String fileName) throws SyntaxException, ClassNotFoundException, IOException
fileName
- is the logical file name of the script (which is used to create the class name of the script)
SyntaxException
ClassNotFoundException
IOException
public Object evaluate(InputStream in, String fileName) throws SyntaxException, ClassNotFoundException, IOException
in
- the stream reading the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)
SyntaxException
ClassNotFoundException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |