JexlScriptEngineFactory (Apache Commons JEXL 3.6.3 API)
Description: declaration: package: org.apache.commons.jexl3.scripting, class: JexlScriptEngineFactory

Package org.apache.commons.jexl3.scripting

# Class JexlScriptEngineFactory

java.lang.Object
org.apache.commons.jexl3.scripting.JexlScriptEngineFactory

All Implemented Interfaces:
  `ScriptEngineFactory`

Direct Known Subclasses:
  `JexlScriptEngine.Factory`

public class JexlScriptEngineFactory extends Object implements ScriptEngineFactory
Implements the JEXL ScriptEngineFactory for JSF-223.

Supports the following:

- Language short names: "JEXL", "Jexl", "jexl", "JEXL2", "Jexl2", "jexl2", "JEXL3", "Jexl3", "jexl3"
- File Extensions: ".jexl", ".jexl2", ".jexl3"
- "jexl3" etc. were added for engineVersion="3.0"

See Java Scripting API Javadoc.

Since:
  2.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JexlScriptEngineFactory()`
  Default constructor.
  `JexlScriptEngineFactory(JexlPermissions jexlPermissions)`
  Constructor with permissions.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected JexlEngine`
  `createJexlEngine()`
  Creates a new JexlEngine instance.
  `protected JexlEngine`
  `getEngine()`
  Creates an engine.
  `String`
  `getEngineName()`
  `String`
  `getEngineVersion()`
  `List<String>`
  `getExtensions()`
  `String`
  `getLanguageName()`
  `String`
  `getLanguageVersion()`
  `String`
  `getMethodCallSyntax(String obj, String m, String... args)`
  `List<String>`
  `getMimeTypes()`
  `List<String>`
  `getNames()`
  `String`
  `getOutputStatement(String toDisplay)`
  `Object`
  `getParameter(String key)`
  `String`
  `getProgram(String... statements)`
  `ScriptEngine`
  `getScriptEngine()`
  `static void`
  `setDefaultPermissions(JexlPermissions permissions)`
  Sets the permissions instance used to create the script engine.

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

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

- ## Constructor Details

  - ### JexlScriptEngineFactory

    public JexlScriptEngineFactory()
    Default constructor.

  - ### JexlScriptEngineFactory

    public JexlScriptEngineFactory(JexlPermissions jexlPermissions)
    Constructor with permissions.

    Meant to reduce dependency to JEXL for extraordinary use case of JSR233.

    Parameters:
      `jexlPermissions` - the permissions instance to use or null to use the `JexlScriptEngineFactory` default

- ## Method Details

  - ### getScriptEngine

    public ScriptEngine getScriptEngine()
    Specified by:
      `getScriptEngine` in interface `ScriptEngineFactory`

  - ### getEngine

    protected JexlEngine getEngine()
    Creates an engine.
    Returns:
      the JexlEngine instance, create it if necessary

  - ### createJexlEngine

    protected JexlEngine createJexlEngine()
    Creates a new JexlEngine instance.
    Returns:
      a new JexlEngine instance

  - ### setDefaultPermissions

    public static void setDefaultPermissions(JexlPermissions permissions)
    Sets the permissions instance used to create the script engine.

    To restore 3.2 unsafe script behavior:

    `JexlScriptEngineFactory.setDefaultPermissions(JexlPermissions.UNRESTRICTED);`
    Parameters:
      `permissions` - the permissions instance to use or null to use the `JexlBuilder` default
    Since:
      3.6.3

  - ### getEngineName

    public String getEngineName()
    Specified by:
      `getEngineName` in interface `ScriptEngineFactory`

  - ### getEngineVersion

    public String getEngineVersion()
    Specified by:
      `getEngineVersion` in interface `ScriptEngineFactory`

  - ### getExtensions

    public List<String> getExtensions()
    Specified by:
      `getExtensions` in interface `ScriptEngineFactory`

  - ### getLanguageName

    public String getLanguageName()
    Specified by:
      `getLanguageName` in interface `ScriptEngineFactory`

  - ### getLanguageVersion

    public String getLanguageVersion()
    Specified by:
      `getLanguageVersion` in interface `ScriptEngineFactory`

  - ### getMethodCallSyntax

    public String getMethodCallSyntax(String obj, String m, String... args)
    Specified by:
      `getMethodCallSyntax` in interface `ScriptEngineFactory`

  - ### getMimeTypes

    public List<String> getMimeTypes()
    Specified by:
      `getMimeTypes` in interface `ScriptEngineFactory`

  - ### getNames

    public List<String> getNames()
    Specified by:
      `getNames` in interface `ScriptEngineFactory`

  - ### getOutputStatement

    public String getOutputStatement(String toDisplay)
    Specified by:
      `getOutputStatement` in interface `ScriptEngineFactory`

  - ### getParameter

    public Object getParameter(String key)
    Specified by:
      `getParameter` in interface `ScriptEngineFactory`

  - ### getProgram

    public String getProgram(String... statements)
    Specified by:
      `getProgram` in interface `ScriptEngineFactory`