Package org.tn5250j.scripting
Class InterpreterDriverManager
- java.lang.Object
-
- org.tn5250j.scripting.InterpreterDriverManager
-
public class InterpreterDriverManager extends java.lang.ObjectClass for managing interpreter drivers. This manager is responsible for keeping track of loaded driver. Interpreter drivers are required to register instance of themselves with this manager when they are loaded.
-
-
Method Summary
Modifier and Type Method Description static voidexecuteScript(SessionPanel session, java.lang.String script, java.lang.String language)Execute a script string Execute the string supplied according to the langauge specifiedstatic voidexecuteScriptFile(java.lang.String scriptFile)Exceute a script file.static voidexecuteScriptFile(SessionPanel session, java.lang.String scriptFile)Exceute a script file.static booleanisScriptSupported(java.lang.String scriptFile)Check if there is a driver that supports the language.static voidregisterDriver(InterpreterDriver driver)Register a driver.
-
-
-
Method Detail
-
registerDriver
public static void registerDriver(InterpreterDriver driver)
Register a driver. Interpreter drivers call this method when they are loaded.- Parameters:
driver- the driver to be registered
-
executeScript
public static void executeScript(SessionPanel session, java.lang.String script, java.lang.String language) throws InterpreterDriver.InterpreterException
Execute a script string Execute the string supplied according to the langauge specified- Parameters:
session- session panel objectscript- script to be executedlanguage- language for interpreting the script string- Throws:
InterpreterDriver.InterpreterException- maybe an exception
-
executeScriptFile
public static void executeScriptFile(SessionPanel session, java.lang.String scriptFile) throws InterpreterDriver.InterpreterException
Exceute a script file. The interpreter driver supporting the language for this file is deduced from file name extension- Parameters:
session- session panel objectscriptFile- file name containing script- Throws:
InterpreterDriver.InterpreterException- maybe an exception
-
executeScriptFile
public static void executeScriptFile(java.lang.String scriptFile) throws InterpreterDriver.InterpreterExceptionExceute a script file. The interpreter driver supporting the language for this file is deduced from file name extension- Parameters:
scriptFile- file name containing script- Throws:
InterpreterDriver.InterpreterException- maybe an exception
-
isScriptSupported
public static boolean isScriptSupported(java.lang.String scriptFile)
Check if there is a driver that supports the language.- Parameters:
scriptFile- file name containing script- Returns:
- flag
-
-