Class BoxScriptingFactory

java.lang.Object
ortus.boxlang.runtime.scripting.BoxScriptingFactory
All Implemented Interfaces:
ScriptEngineFactory

public class BoxScriptingFactory extends Object implements ScriptEngineFactory
BoxScriptingFactory is used to describe and instantiate ScriptEngines for BoxLang based on JSR-223. See ScriptEngineManager() and ScriptEngineManager(java.lang.ClassLoader).
  • Constructor Details

    • BoxScriptingFactory

      public BoxScriptingFactory()
  • Method Details

    • getEngineName

      public String getEngineName()
      Returns the name of the scripting engine.
      Specified by:
      getEngineName in interface ScriptEngineFactory
      Returns:
      The name of the scripting engine.
    • getEngineVersion

      public String getEngineVersion()
      Returns the version of the scripting engine.
      Specified by:
      getEngineVersion in interface ScriptEngineFactory
      Returns:
      The version of the scripting engine.
    • getLanguageName

      public String getLanguageName()
      Returns the name of the scripting language supported by the engine.
      Specified by:
      getLanguageName in interface ScriptEngineFactory
      Returns:
      The name of the scripting language supported by the engine.
    • getLanguageVersion

      public String getLanguageVersion()
      Returns the version of the scripting language supported by the engine.
      Specified by:
      getLanguageVersion in interface ScriptEngineFactory
      Returns:
      The version of the scripting language supported by the engine.
    • getMethodCallSyntax

      public String getMethodCallSyntax(String obj, String m, String... args)
      Builds a BoxLang method call using the object and method name and the arguments
      Specified by:
      getMethodCallSyntax in interface ScriptEngineFactory
      Parameters:
      obj - The object to call the method on
      m - The method to call
      args - The arguments to pass to the method
      Returns:
      The constructed BoxLang method call
    • getOutputStatement

      public String getOutputStatement(String toDisplay)
      Build a BoxLang output statement using writeoutput
      Specified by:
      getOutputStatement in interface ScriptEngineFactory
      Parameters:
      toDisplay - The string to display
      Returns:
      A BoxLang output statement
    • getProgram

      public String getProgram(String... statements)
      Builds out a program from a collection of statemetns by joining them with semicolons and newlines
      Specified by:
      getProgram in interface ScriptEngineFactory
      Parameters:
      statements - The statements to be executed
      Returns:
      A valid BoxLang program
    • getScriptEngine

      public ScriptEngine getScriptEngine()
      Build a new BoxLang ScriptEngine
      Specified by:
      getScriptEngine in interface ScriptEngineFactory
      Returns:
      A new BoxLang ScriptEngine
    • getScriptEngine

      public BoxScriptingEngine getScriptEngine(Boolean debug)
      Build a new BoxLang ScriptEngine
      Parameters:
      debug - Whether or not to enable debugging
      Returns:
      A new BoxLang ScriptEngine
    • getExtensions

      public List<String> getExtensions()
      Get the supported extensions for BoxLang
      Specified by:
      getExtensions in interface ScriptEngineFactory
    • getMimeTypes

      public List<String> getMimeTypes()
      Get the supported mime types for BoxLang
      Specified by:
      getMimeTypes in interface ScriptEngineFactory
    • getNames

      public List<String> getNames()
      Get the supported names for BoxLang
      Specified by:
      getNames in interface ScriptEngineFactory
    • getParameter

      public Object getParameter(String key)
      Get the supported parameters for BoxLang
      Specified by:
      getParameter in interface ScriptEngineFactory
      Parameters:
      key - The key to get the parameter for
      Returns:
      The parameter value