Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ulu.view
Class ScriptedMethod  view ScriptedMethod download ScriptedMethod.java

java.lang.Object
  extended byjava.util.Observable
      extended byulu.view.Flagged
          extended byulu.view.UMethod
              extended byulu.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.


Field Summary
protected  java.lang.String Script
          script text to be fed to the script engine
 
Fields inherited from class ulu.view.UMethod
handler, Name, PARAM_NAME_TARGET_OBJECT, params, Return
 
Fields inherited from class ulu.view.Flagged
FLAG_ALLOWED_VALS, FLAG_GROUP_MEMBERSHIP, FLAG_HIDDEN, FLAG_OPTIONAL, FLAG_RETURN_INLINE, FLAG_SUGGESTED_VALS, flags, MEMBERSHIP_GROUP_DEFAULT_VISIBLE, MEMBERSHIP_GROUP_GENERAL, MEMBERSHIP_GROUP_UBIQUITOUS
 
Fields inherited from class java.util.Observable
 
Constructor Summary
ScriptedMethod(java.lang.String n, java.lang.String script)
          constructor requires name and script text
ScriptedMethod(java.lang.String n, java.lang.String group, java.lang.String script)
          constructor requires name and script text
 
Method Summary
 java.lang.String getScript()
          the script text to be executed
 java.lang.Object invoke(UMethod m)
          invoke a Method by handing it to the scripting engine and returning the result
 
Methods inherited from class ulu.view.UMethod
addParam, addParams, addParams, complete, countParams, getHandler, getName, getParam, getParams, getReturn, invoke
 
Methods inherited from class ulu.view.Flagged
get, set
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Script

protected java.lang.String Script
script text to be fed to the script engine

Constructor Detail

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

Method Detail

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