|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.scripting.Jython
public class Jython
A helper class for Jython.
scripting.Jython,
Serialized Form| Field Summary | |
|---|---|
static String |
CLASS_PYTHONINERPRETER
the classname of the Python interpreter. |
static String |
CLASS_PYTHONOBJECTINPUTSTREAM
the classname of the Python ObjectInputStream. |
protected Object |
m_Interpreter
the interpreter. |
protected static boolean |
m_Present
whether the Jython classes are in the Classpath. |
| Constructor Summary | |
|---|---|
Jython()
default constructor, tries to instantiate a Python Interpreter. |
|
| Method Summary | |
|---|---|
static Object |
deserialize(InputStream in)
deserializes the Python Object from the stream. |
Object |
getInterpreter()
returns the currently used Python Interpreter. |
static Object |
invoke(Object o,
String methodName,
Class[] paramClasses,
Object[] paramValues)
executes the specified method and returns the result, if any. |
Object |
invoke(String methodName,
Class[] paramClasses,
Object[] paramValues)
executes the specified method on the current interpreter and returns the result, if any. |
static boolean |
isPresent()
returns whether the Jython classes are present or not, i.e. |
static Object[] |
loadScriptObject(Class cls,
adams.core.io.PlaceholderFile scriptFile,
JythonScript inlineScript,
String scriptOptions)
Loads the scripts object and sets its options. |
static void |
main(String[] args)
If no arguments are given, it just prints the presence of the Jython classes, otherwise it expects a Jython filename to execute. |
static Object |
newInstance(File file,
Class template)
loads the module and returns a new instance of it as instance of the provided Java class template. |
static Object |
newInstance(File file,
Class template,
File[] paths)
loads the module and returns a new instance of it as instance of the provided Java class template. |
static Object |
newInterpreter()
initializes and returns a Python Interpreter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CLASS_PYTHONINERPRETER
public static final String CLASS_PYTHONOBJECTINPUTSTREAM
protected static boolean m_Present
protected Object m_Interpreter
| Constructor Detail |
|---|
public Jython()
| Method Detail |
|---|
public Object getInterpreter()
public Object invoke(String methodName,
Class[] paramClasses,
Object[] paramValues)
methodName - the name of the methodparamClasses - the classes of the parametersparamValues - the values of the parameters
public static boolean isPresent()
public static Object newInterpreter()
public static Object newInstance(File file,
Class template)
file - the Jython module filetemplate - the template for the returned Java object
public static Object newInstance(File file,
Class template,
File[] paths)
file - the Jython module filetemplate - the template for the returned Java objectpaths - additional paths to add to "sys.path"
public static Object invoke(Object o,
String methodName,
Class[] paramClasses,
Object[] paramValues)
o - the object the method should be called from,
e.g., a Python InterpretermethodName - the name of the methodparamClasses - the classes of the parametersparamValues - the values of the parameters
public static Object deserialize(InputStream in)
in - the stream to use
public static Object[] loadScriptObject(Class cls,
adams.core.io.PlaceholderFile scriptFile,
JythonScript inlineScript,
String scriptOptions)
cls - the class to instantiatescriptFile - the external file to loadinlineScript - the inline script to load if external file points to a directoryscriptOptions - the options to set
public static void main(String[] args)
args - commandline arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||