JepConfig
Date: 2017-11-20

jep

## Class JepConfig

- java.lang.Object
- - jep.JepConfig

-     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.

  Since:
    3.5

- - ### Field Summary

    Fields
    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`
    `protected java.util.Set<java.lang.String>` | `sharedModules`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JepConfig()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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` | `addSharedModules(java.lang.String... sharedModule)` Adds module names to the set of shared modules
    `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
    `JepConfig` | `setSharedModules(java.util.Set<java.lang.String> sharedModules)` Sets the names of modules which should be shared with other Jep sub-interpreters.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### interactive

          protected boolean interactive

    - #### includePath

          protected java.lang.StringBuilder includePath

    - #### classLoader

          protected java.lang.ClassLoader classLoader

    - #### classEnquirer

          protected ClassEnquirer classEnquirer

    - #### redirectOutputStreams

          protected boolean redirectOutputStreams

    - #### sharedModules

          protected java.util.Set<java.lang.String> sharedModules

  - ### Constructor Detail

    - #### JepConfig

          public JepConfig()

  - ### Method Detail

    - #### setInteractive

          public JepConfig setInteractive(boolean interactive)

      Sets whether `Jep.eval(String)` should support the slower behavior of potentially waiting for multiple statements
      Parameters:
        `interactive` - whether the Jep instance should be interactive
      Returns:
        a reference to this JepConfig

    - #### setIncludePath

          public 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`
      Parameters:
        `includePath` - directory or directories to include on sys.path
      Returns:
        a reference to this JepConfig

    - #### addIncludePaths

          public 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`
      Parameters:
        `includePaths` - directories to include on sys.path
      Returns:
        a reference to this JepConfig

    - #### setClassLoader

          public JepConfig setClassLoader(java.lang.ClassLoader classLoader)

      Sets the ClassLoader to use when importing Java classes from Python
      Parameters:
        `classLoader` - the initial ClassLoader for the Jep instance
      Returns:
        a reference to this JepConfig

    - #### setClassEnquirer

          public JepConfig setClassEnquirer(ClassEnquirer classEnquirer)

      Sets a ClassEnquirer to determine which imports are Python vs Java, or null for the default `ClassList`
      Parameters:
        `classEnquirer` - the ClassEnquirer for the Jep instance
      Returns:
        a reference to this JepConfig

    - #### setRedirectOutputStreams

          public 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
      Parameters:
        `redirectOutputStreams` - whether to redirect Python streams to Java
      Returns:
        a reference to this JepConfig

    - #### setSharedModules

          public JepConfig setSharedModules(java.util.Set<java.lang.String> sharedModules)

      Sets the names of modules which should be shared with other Jep sub-interpreters. This can make it possible to use modules which are not designed for use from Python sub-interpreters. This should not be necessary for any module written in Python but is intended for extensions that use the c-api. For a complete discussion of the types of problems that can require shared modules see the documentation on shared_modules_hook.py.
      Parameters:
        `sharedModules` - a set of module names that should be shared
      Returns:
        a reference to this JepConfig
      Since:
        3.6

    - #### addSharedModules

          public JepConfig addSharedModules(java.lang.String... sharedModule)

      Adds module names to the set of shared modules
      Parameters:
        `sharedModule` - a set of module names that should be shared
      Returns:
        a reference to this JepConfig
      Since:
        3.6
      See Also:
        `setSharedModules(Set)`