|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.Jython
public class Jython
A helper class for Jython.
Field Summary | |
---|---|
static java.lang.String |
CLASS_PYTHONINERPRETER
the classname of the Python interpreter |
static java.lang.String |
CLASS_PYTHONOBJECTINPUTSTREAM
the classname of the Python ObjectInputStream |
Constructor Summary | |
---|---|
Jython()
default constructor, tries to instantiate a Python Interpreter |
Method Summary | |
---|---|
static java.lang.Object |
deserialize(java.io.InputStream in)
deserializes the Python Object from the stream |
java.lang.Object |
getInterpreter()
returns the currently used Python Interpreter |
java.lang.String |
getRevision()
Returns the revision string. |
static java.lang.Object |
invoke(java.lang.Object o,
java.lang.String methodName,
java.lang.Class[] paramClasses,
java.lang.Object[] paramValues)
executes the specified method and returns the result, if any |
java.lang.Object |
invoke(java.lang.String methodName,
java.lang.Class[] paramClasses,
java.lang.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 void |
main(java.lang.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 java.lang.Object |
newInstance(java.io.File file,
java.lang.Class template)
loads the module and returns a new instance of it as instance of the provided Java class template. |
static java.lang.Object |
newInstance(java.io.File file,
java.lang.Class template,
java.io.File[] paths)
loads the module and returns a new instance of it as instance of the provided Java class template. |
static java.lang.Object |
newInterpreter()
initializes and returns a Python Interpreter |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_PYTHONINERPRETER
public static final java.lang.String CLASS_PYTHONOBJECTINPUTSTREAM
Constructor Detail |
---|
public Jython()
Method Detail |
---|
public java.lang.Object getInterpreter()
public java.lang.Object invoke(java.lang.String methodName, java.lang.Class[] paramClasses, java.lang.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 boolean isPresent()
public static java.lang.Object newInterpreter()
public static java.lang.Object newInstance(java.io.File file, java.lang.Class template)
filename
- the path to the Jython module, incl. filenametemplate
- the template for the returned Java object
public static java.lang.Object newInstance(java.io.File file, java.lang.Class template, java.io.File[] paths)
filename
- the path to the Jython module, incl. filenametemplate
- the template for the returned Java objectpaths
- additional paths to add to "sys.path"
public static java.lang.Object invoke(java.lang.Object o, java.lang.String methodName, java.lang.Class[] paramClasses, java.lang.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 java.lang.Object deserialize(java.io.InputStream in)
in
- the stream to use
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
public static void main(java.lang.String[] args)
args
- commandline arguments
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |