Package org.rexxla.bsf.engines.rexx
Class RexxScriptEngineFactory
java.lang.Object
org.rexxla.bsf.engines.rexx.RexxScriptEngineFactory
- All Implemented Interfaces:
ScriptEngineFactory
Class that implements the
javax.script.ScriptEngineFactory interface for the ooRexx support.- Since:
- 2015-05-11
- Version:
- 100.20220806
- Author:
- Rony G. Flatscher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanField controls whethergetOutputStatement(String toDisplay)uses the RexxSAY(always appends a line-feed character) keyword statement or the ooRexx.outputmonitor with thecharOutmethod (will output the string as is without appending anything).static final RexxScriptEngineFactoryIf a RexxScriptEngine gets created directly, allow it to fetch an instance of the RexxScriptEngineFactory.protected static final Stringprotected static final Stringprotected static final Stringprotected static Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the full name of the ScriptEngine.Returns the version of the ScriptEngine.Returns an immutable list of filename extensions, which generally identify scripts written in the language supported by this ScriptEngine.static StringUtility method that creates and returns a GMT-based ISO date string.Returns the name of the scripting langauge supported by this ScriptEngine.Returns the version of the scripting language supported by this ScriptEngine.getMethodCallSyntax(String obj, String m, String... args) Returns a String which can be used to invoke a method of a Java object using the syntax of the supported scripting language.Returns an immutable list of mimetypes, associated with scripts that can be executed by the engine.getName()Returns the short name of the scripting language supported by this ScriptEngine.getNames()Returns an immutable list of short names for the ScriptEngine, which may be used to identify the ScriptEngine by the ScriptEngineManager.getOutputStatement(String toDisplay) Returns a String that can be used as a statement to display the specified String using the syntax of the supported scripting language.getParameter(String key) Returns the value of an attribute whose meaning may be implementation-specific.getProgram(String... statements) Returns a valid scripting language executable program with given statements.Creates and returns a new RexxScriptEngine instance.static StringgetStringLiteral(String toDisplay) Creates and returns a quoted Rexx string, with carriage return (CR) and line-feed (LF) characters escaped as concatenated Rexx hex strings.
-
Field Details
-
DEFAULT_REXX_SCRIPT_ENGINE_FACTORY
If a RexxScriptEngine gets created directly, allow it to fetch an instance of the RexxScriptEngineFactory. -
ENGINE_NAME
- See Also:
-
ENGINE_VERSION
- See Also:
-
EXTENSIONS
-
LANGUAGE_NAME
- See Also:
-
LANGUAGE_VERSION
-
SHORT_NAME
- See Also:
-
MIME_TYPES
-
SCRIPT_ENGINE_SHORT_NAMES
-
THREADING
- See Also:
-
bSay4Output
public static boolean bSay4OutputField controls whethergetOutputStatement(String toDisplay)uses the RexxSAY(always appends a line-feed character) keyword statement or the ooRexx.outputmonitor with thecharOutmethod (will output the string as is without appending anything). This field is set totrueby default causing theSAYkeyword statement to be used.
-
-
Constructor Details
-
RexxScriptEngineFactory
public RexxScriptEngineFactory()
-
-
Method Details
-
getEngineName
Returns the full name of the ScriptEngine.- Specified by:
getEngineNamein interfaceScriptEngineFactory
-
getEngineVersion
Returns the version of the ScriptEngine.- Specified by:
getEngineVersionin interfaceScriptEngineFactory
-
getExtensions
Returns an immutable list of filename extensions, which generally identify scripts written in the language supported by this ScriptEngine.- Specified by:
getExtensionsin interfaceScriptEngineFactory
-
getLanguageName
Returns the name of the scripting langauge supported by this ScriptEngine.- Specified by:
getLanguageNamein interfaceScriptEngineFactory
-
getLanguageVersion
Returns the version of the scripting language supported by this ScriptEngine.- Specified by:
getLanguageVersionin interfaceScriptEngineFactory
-
getName
Returns the short name of the scripting language supported by this ScriptEngine. -
getMethodCallSyntax
Returns a String which can be used to invoke a method of a Java object using the syntax of the supported scripting language.- Specified by:
getMethodCallSyntaxin interfaceScriptEngineFactory- Parameters:
obj- - The name representing the object whose method is to be invoked.m- - The name of the method to invoke.args- - names of the arguments in the method call.
-
getMimeTypes
Returns an immutable list of mimetypes, associated with scripts that can be executed by the engine.- Specified by:
getMimeTypesin interfaceScriptEngineFactory
-
getNames
Returns an immutable list of short names for the ScriptEngine, which may be used to identify the ScriptEngine by the ScriptEngineManager.- Specified by:
getNamesin interfaceScriptEngineFactory
-
getOutputStatement
Returns a String that can be used as a statement to display the specified String using the syntax of the supported scripting language. The boolean fieldbSay4Outputvalue controls whetherSAY(true) or.output~charOut(false) gets employed.- Specified by:
getOutputStatementin interfaceScriptEngineFactory
-
getStringLiteral
Creates and returns a quoted Rexx string, with carriage return (CR) and line-feed (LF) characters escaped as concatenated Rexx hex strings.- Parameters:
toDisplay- the string to encode as a Rexx string literal, if null then ".nil" gets returned- Returns:
- a Rexx encoded string
-
getParameter
Returns the value of an attribute whose meaning may be implementation-specific.- Specified by:
getParameterin interfaceScriptEngineFactory
-
getProgram
Returns a valid scripting language executable program with given statements.- Specified by:
getProgramin interfaceScriptEngineFactory
-
getScriptEngine
Creates and returns a new RexxScriptEngine instance.- Specified by:
getScriptEnginein interfaceScriptEngineFactory
-
getGMTFormattedDateAsISO
Utility method that creates and returns a GMT-based ISO date string.- Returns:
- the current ISO date, edited to be usable as a filename
-