Package: org.apache.groovy.groovysh.jline

## [Java] Class GroovyEngine

- org.apache.groovy.groovysh.jline.GroovyEngine

- All Implemented Interfaces and Traits:
    org.jline.console.ScriptEngine

      public class GroovyEngine
      extends Object
      implements org.jline.console.ScriptEngine

  Implements Groovy ScriptEngine. You must be very careful when using GroovyEngine in a multithreaded environment. The Binding instance is not thread safe, and it is shared by all scripts.

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `protected static class` | `GroovyEngine.AccessRules` |
    `interface` | `GroovyEngine.Cloner` |
    `static class` | `GroovyEngine.EngineClassLoader` |
    `enum` | `GroovyEngine.Format` |

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `ALL_CLASSES_COMPLETION` |
    `static String` | `ALL_CONSTRUCTORS_COMPLETION` |
    `static String` | `ALL_FIELDS_COMPLETION` |
    `static String` | `ALL_METHODS_COMPLETION` |
    `static String` | `CANONICAL_NAMES` |
    `static String` | `GROOVY_COLORS` |
    `static String` | `IDENTIFIERS_COMPLETION` |
    `static String` | `META_METHODS_COMPLETION` |
    `static String` | `NANORC_SYNTAX` |
    `static String` | `NANORC_VALUE` |
    `static String` | `NO_SYNTAX_CHECK` |
    `static String` | `RESTRICTED_COMPLETION` |
    `static String` | `SYNTHETIC_METHODS_COMPLETION` |
    `protected GroovyEngine.EngineClassLoader` | `classLoader` |
    `protected Binding` | `sharedData` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GroovyEngine()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `del(String vars)`
    `` | `public Object` | `deserialize(String value, String formatStr)`
    `` | `public Object` | `execute(File script, Object[] args)`
    `` | `public Object` | `execute(String statement)`
    `` | `public Object` | `execute(Object closure, Object args)`
    `` | `public Map<String, Object>` | `find(String name)`
    `` | `public Object` | `get(String name)`
    `` | `public String` | `getBuffer()`
    `` | `public List<String>` | `getDeserializationFormats()`
    `` | `public String` | `getEngineName()`
    `` | `public List<String>` | `getExtensions()`
    `` | `public Map<String, String>` | `getImports()`
    `` | `public Set<String>` | `getMethodNames()`
    `` | `public Map<String, String>` | `getMethods()`
    `` | `public GroovyEngine.Cloner` | `getObjectCloner()`
    `` | `public org.jline.reader.Completer` | `getScriptCompleter()`
    `` | `public List<String>` | `getSerializationFormats()`
    `` | `protected org.jline.builtins.SyntaxHighlighter` | `getSyntaxHighlighter()`
    `` | `public Map<String, String>` | `getTypes()`
    `` | `public Map<String, String>` | `getVariables()`
    `<T>` | `protected T` | `groovyOption(String option, T defval)`
    `<T>` | `protected static T` | `groovyOption(Map<String, Object> options, String option, T defval)`
    `` | `protected Map<String, Object>` | `groovyOptions()`
    `` | `public boolean` | `hasVariable(String name)`
    `` | `public void` | `persist(Path file, Object object)`
    `` | `public void` | `persist(Path file, Object object, String format)`
    `` | `public void` | `purgeClassCache(String regex)`
    `` | `public void` | `put(String name, Object value)`
    `` | `public boolean` | `refresh()`
    `` | `public void` | `removeImport(String name)`
    `` | `public void` | `removeMethod(String name)`
    `` | `public void` | `removeType(String name)`
    `` | `public void` | `removeVariable(String name)`
    `` | `public void` | `reset()`
    `` | `public org.jline.console.CmdDesc` | `scriptDescription(org.jline.console.CmdLine line)`
    `` | `public void` | `setObjectCloner(GroovyEngine.Cloner objectCloner)`
    `` | `public String` | `toJson(Object obj)`
    `` | `public Map<String, Object>` | `toMap(Object obj)`
    `` | `public String` | `toString(Object obj)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### public static final String ALL_CLASSES_COMPLETION

    - #### public static final String ALL_CONSTRUCTORS_COMPLETION

    - #### public static final String ALL_FIELDS_COMPLETION

    - #### public static final String ALL_METHODS_COMPLETION

    - #### public static final String CANONICAL_NAMES

    - #### public static final String GROOVY_COLORS

    - #### public static final String IDENTIFIERS_COMPLETION

    - #### public static final String META_METHODS_COMPLETION

    - #### public static final String NANORC_SYNTAX

    - #### public static final String NANORC_VALUE

    - #### public static final String NO_SYNTAX_CHECK

    - #### public static final String RESTRICTED_COMPLETION

    - #### public static final String SYNTHETIC_METHODS_COMPLETION

    - #### protected final GroovyEngine.EngineClassLoader classLoader

    - #### protected Binding sharedData

  - ### Constructor Detail

    - #### public GroovyEngine()

  - ### Method Detail

    - #### @Override
      public void del(String vars)

    - #### @Override
      public Object deserialize(String value, String formatStr)

    - #### @Override
      public Object execute(File script, Object[] args)

    - #### @Override
      public Object execute(String statement)

    - #### @Override
      public Object execute(Object closure, Object args)

    - #### @SuppressWarnings("unchecked")
      @Override
      public Map<String, Object> find(String name)

    - #### @Override
      public Object get(String name)

    - #### public String getBuffer()

    - #### @Override
      public List<String> getDeserializationFormats()

    - #### @Override
      public String getEngineName()

    - #### @Override
      public List<String> getExtensions()

    - #### public Map<String, String> getImports()

    - #### public Set<String> getMethodNames()

    - #### public Map<String, String> getMethods()

    - #### public GroovyEngine.Cloner getObjectCloner()

    - #### @Override
      public org.jline.reader.Completer getScriptCompleter()

    - #### @Override
      public List<String> getSerializationFormats()

    - #### protected org.jline.builtins.SyntaxHighlighter getSyntaxHighlighter()

    - #### public Map<String, String> getTypes()

    - #### public Map<String, String> getVariables()

    - #### <T> protected T groovyOption(String option, T defval)

    - #### <T> @SuppressWarnings("unchecked")
      protected static T groovyOption(Map<String, Object> options, String option, T defval)

    - #### @SuppressWarnings("unchecked")
      protected Map<String, Object> groovyOptions()

    - #### @Override
      public boolean hasVariable(String name)

    - #### @Override
      public void persist(Path file, Object object)

    - #### @Override
      public void persist(Path file, Object object, String format)

    - #### public void purgeClassCache(String regex)

    - #### @Override
      public void put(String name, Object value)

    - #### public boolean refresh()

    - #### public void removeImport(String name)

    - #### public void removeMethod(String name)

    - #### public void removeType(String name)

    - #### public void removeVariable(String name)

    - #### public void reset()

    - #### public org.jline.console.CmdDesc scriptDescription(org.jline.console.CmdLine line)

    - #### public void setObjectCloner(GroovyEngine.Cloner objectCloner)

    - #### @Override
      public String toJson(Object obj)

    - #### @Override
      public Map<String, Object> toMap(Object obj)

    - #### @Override
      public String toString(Object obj)