public class JepConfig
extends java.lang.Object
A configuration object for constructing a Jep instance, corresponding to the configuration of the particular Python sub-interpreter. This class is intended to make constructing Jep instances easier while maintaining compatible APIs between releases.
Modifier and Type | Field and Description |
---|---|
protected ClassEnquirer |
classEnquirer |
protected java.lang.ClassLoader |
classLoader |
protected java.lang.StringBuilder |
includePath |
protected boolean |
interactive |
protected boolean |
redirectOutputStreams |
Constructor and Description |
---|
JepConfig() |
Modifier and Type | Method and Description |
---|---|
JepConfig |
addIncludePaths(java.lang.String... includePaths)
Adds a path of directories separated by File.pathSeparator that will be
appended to the sub-intepreter's
sys.path |
JepConfig |
setClassEnquirer(ClassEnquirer classEnquirer)
Sets a ClassEnquirer to determine which imports are Python vs Java, or
null for the default
ClassList |
JepConfig |
setClassLoader(java.lang.ClassLoader classLoader)
Sets the ClassLoader to use when importing Java classes from Python
|
JepConfig |
setIncludePath(java.lang.String includePath)
Sets a path of directories separated by File.pathSeparator that will be
appended to the sub-intepreter's
sys.path |
JepConfig |
setInteractive(boolean interactive)
Sets whether
Jep.eval(String) should support the slower
behavior of potentially waiting for multiple statements |
JepConfig |
setRedirectOutputStreams(boolean redirectOutputStreams)
Sets whether to redirect the Python sys.stdout and sys.stderr streams to
the Java System.out and System.err streams
|
protected boolean interactive
protected java.lang.StringBuilder includePath
protected java.lang.ClassLoader classLoader
protected ClassEnquirer classEnquirer
protected boolean redirectOutputStreams
public JepConfig setInteractive(boolean interactive)
Jep.eval(String)
should support the slower
behavior of potentially waiting for multiple statementsinteractive
- whether the Jep instance should be interactivepublic JepConfig setIncludePath(java.lang.String includePath)
sys.path
includePath
- directory or directories to include on sys.pathpublic JepConfig addIncludePaths(java.lang.String... includePaths)
sys.path
includePaths
- directories to include on sys.pathpublic JepConfig setClassLoader(java.lang.ClassLoader classLoader)
classLoader
- the initial ClassLoader for the Jep instancepublic JepConfig setClassEnquirer(ClassEnquirer classEnquirer)
ClassList
classEnquirer
- the ClassEnquirer for the Jep instancepublic JepConfig setRedirectOutputStreams(boolean redirectOutputStreams)
redirectOutputStreams
- whether to redirect Python streams to Java