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

Quick Search    Search Deep

ulu.ut
Class Scripter  view Scripter download Scripter.java

java.lang.Object
  extended byulu.ut.Scripter

public class Scripter
extends java.lang.Object

A script-handling utility that allows embedded running of jython scripts in the ui - originally intended for startup scripts to populate the top-level view of the sirius ui. No doubt it will come in useful elsewhere too.

Thanks to Ed Kenworthy and Samuele Pedroni for helpful advice via the jython-users list.


Field Summary
(package private) static PythonInterpreter interp
          python interpreter
 
Constructor Summary
Scripter()
           
 
Method Summary
static void exec(java.lang.String code)
          run a command in the python interpreter
static void execStream(java.io.InputStream is)
          pass a stream of code to the interpreter
static java.lang.Object get(java.lang.String name, java.lang.Class cls)
          get a object from the python namespace, specifying the class to cast it back to
static java.util.Vector getLocalNames()
          get a list of all local variable names
static void set(java.lang.String name, java.lang.Object obj)
          expose an object to python under following name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interp

static PythonInterpreter interp
python interpreter

Constructor Detail

Scripter

public Scripter()
Method Detail

set

public static void set(java.lang.String name,
                       java.lang.Object obj)
expose an object to python under following name


get

public static java.lang.Object get(java.lang.String name,
                                   java.lang.Class cls)
get a object from the python namespace, specifying the class to cast it back to


exec

public static void exec(java.lang.String code)
run a command in the python interpreter


execStream

public static void execStream(java.io.InputStream is)
pass a stream of code to the interpreter


getLocalNames

public static java.util.Vector getLocalNames()
get a list of all local variable names