Package de.elo.utils.io
Class CallbackContext
java.lang.Object
de.elo.utils.io.CallbackContext
public class CallbackContext
extends java.lang.Object
Überschrift: CallbackContext.
Beschreibung: Kontext-Information, welche die Callback-Funktion und die notwenigen Umgebungsinformationen enthält.
Copyright: Copyright (c) ELO Digital Office GmbH 2018
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
scriptFolder
Scriptordner für Includes und Ressourcenjava.lang.String
scriptName
Scriptnameorg.mozilla.javascript.Scriptable
scriptScope
ScriptScope für Globalen, etc. -
Method Summary
Modifier and Type Method Description CallbackContext
createCallback(org.mozilla.javascript.BaseFunction function, org.mozilla.javascript.Scriptable thisScope)
Die Funktion erstellt einen erweiterten Kontext, welcher neben dem ausgefphrten Script auch eine Callback-Funktion und den Scope der Funktion enthält.static CallbackContext
setupContext(org.mozilla.javascript.Scriptable scriptScope, java.lang.String scriptFolder, java.lang.String scriptName)
Neuen Context erstellen.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
scriptScope
public final org.mozilla.javascript.Scriptable scriptScopeScriptScope für Globalen, etc. -
scriptFolder
public final java.lang.String scriptFolderScriptordner für Includes und Ressourcen -
scriptName
public final java.lang.String scriptNameScriptname
-
-
Method Details
-
setupContext
public static CallbackContext setupContext(org.mozilla.javascript.Scriptable scriptScope, java.lang.String scriptFolder, java.lang.String scriptName)Neuen Context erstellen. Dieser Context enthält nur Informationen zum ausgeführten Script.- Parameters:
scriptScope
- Scope des aufgerufenen ScriptesscriptFolder
- Ordner des aufgerufenen ScriptesscriptName
- Name des aufgerufenen Scriptes- Returns:
- Context
-
createCallback
public CallbackContext createCallback(org.mozilla.javascript.BaseFunction function, org.mozilla.javascript.Scriptable thisScope)Die Funktion erstellt einen erweiterten Kontext, welcher neben dem ausgefphrten Script auch eine Callback-Funktion und den Scope der Funktion enthält.- Parameters:
function
- JavaScript-FunktionthisScope
- "this"-Scope der Funktion- Returns:
- Erweiterter Kontext
-