ulu.view
Class ScriptedMethod

java.lang.Object
java.util.Observable
ulu.view.Flagged
ulu.view.UMethod
ulu.view.ScriptedMethod
- All Implemented Interfaces:
- Handler, java.io.Serializable
- public class ScriptedMethod
- extends UMethod
- implements Handler
A method that executes a piece of script code when executed. In principle, any
bit of text can be executed, but in practise, its easiest to define that text as a
method in the startup script, and give the ScriptMethod a one-line call to that
script.
At present, parameters aren't supported, but these can easily be accomodated using the
ParamString object - a suitable subclass will be created in due course.
| Methods inherited from class ulu.view.UMethod |
addParam, addParams, addParams, complete, countParams, getHandler, getName, getParam, getParams, getReturn, invoke |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Script
protected java.lang.String Script
- script text to be fed to the script engine
ScriptedMethod
public ScriptedMethod(java.lang.String n,
java.lang.String script)
throws java.lang.NullPointerException
- constructor requires name and script text
ScriptedMethod
public ScriptedMethod(java.lang.String n,
java.lang.String group,
java.lang.String script)
throws java.lang.NullPointerException
- constructor requires name and script text
getScript
public java.lang.String getScript()
- the script text to be executed
invoke
public java.lang.Object invoke(UMethod m)
throws java.lang.Exception
- invoke a Method by handing it to the scripting engine and returning the result
- Specified by:
invoke in interface Handler