|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgroovy.lang.GroovyObjectSupport
groovy.lang.Script
This object represents a Groovy script
| Field Summary | |
private Binding |
binding
|
| Fields inherited from class groovy.lang.GroovyObjectSupport |
|
| Constructor Summary | |
protected |
Script()
|
protected |
Script(Binding binding)
|
| Method Summary | |
java.lang.Object |
evaluate(java.io.File file)
A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope |
java.lang.Object |
evaluate(java.lang.String expression)
A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope |
Binding |
getBinding()
|
java.lang.Object |
getProperty(java.lang.String property)
|
java.lang.Object |
invokeMethod(java.lang.String name,
java.lang.Object args)
Invoke a method (or closure in the binding) defined. |
void |
print(java.lang.Object value)
Prints the value to the current 'out' variable which should be a PrintWriter or at least have a print() method defined on it. |
void |
println()
Prints a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it. |
void |
println(java.lang.Object value)
Prints the value and a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it. |
abstract java.lang.Object |
run()
The main instance method of a script which has variables in scope as defined by the current Binding instance. |
void |
run(java.io.File file,
java.lang.String[] arguments)
A helper method to allow scripts to be run taking command line arguments |
void |
setBinding(Binding binding)
|
void |
setProperty(java.lang.String property,
java.lang.Object newValue)
Sets the given property to the new value |
| Methods inherited from class groovy.lang.GroovyObjectSupport |
getMetaClass, setMetaClass |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private Binding binding
| Constructor Detail |
protected Script()
protected Script(Binding binding)
| Method Detail |
public Binding getBinding()
public void setBinding(Binding binding)
public java.lang.Object getProperty(java.lang.String property)
getProperty in interface GroovyObjectgetProperty in class GroovyObjectSupport
public void setProperty(java.lang.String property,
java.lang.Object newValue)
GroovyObject
setProperty in interface GroovyObjectsetProperty in class GroovyObjectSupport
public java.lang.Object invokeMethod(java.lang.String name,
java.lang.Object args)
invokeMethod in interface GroovyObjectinvokeMethod in class GroovyObjectSupportname - method to callargs - arguments to pass to the method
public abstract java.lang.Object run()
Binding instance.
public void println()
public void print(java.lang.Object value)
public void println(java.lang.Object value)
public java.lang.Object evaluate(java.lang.String expression)
throws CompilationFailedException,
java.io.IOException
expression - is the Groovy script expression to evaluate
CompilationFailedException
java.io.IOException
public java.lang.Object evaluate(java.io.File file)
throws CompilationFailedException,
java.io.IOException
file - is the Groovy script to evaluate
CompilationFailedException
java.io.IOException
public void run(java.io.File file,
java.lang.String[] arguments)
throws CompilationFailedException,
java.io.IOException
CompilationFailedException
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||