Class ScriptFunctionHelper
- java.lang.Object
-
- com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper
-
- Direct Known Subclasses:
ExtensionFunctionImpl
,PropertyChangeScript
,ScriptAction
,ScriptRunner
public abstract class ScriptFunctionHelper extends java.lang.Object
Helper to consolidate the logic of an extension-function style script that must be compiled the first time before it runs.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
signature
-
Constructor Summary
Constructors Modifier Constructor Description protected
ScriptFunctionHelper(java.lang.String signature, java.lang.String userCode)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract PerspectiveElement
getComponent()
protected java.lang.String
getDescription()
Describe the location/context of this script.protected LoggerEx
getLog()
java.util.Optional<org.python.core.PyObject>
invoke(org.python.core.PyObject... arguments)
protected void
logWarn(java.lang.String message, java.lang.Throwable error)
void
onScriptLibraryChange(ScriptLibChangeEvent event)
static QualifiedValue
py2qualified(org.python.core.PyObject object)
-
-
-
Method Detail
-
getLog
protected LoggerEx getLog()
-
getComponent
protected abstract PerspectiveElement getComponent()
-
onScriptLibraryChange
public void onScriptLibraryChange(ScriptLibChangeEvent event)
-
invoke
public java.util.Optional<org.python.core.PyObject> invoke(org.python.core.PyObject... arguments)
- Returns:
- the return value, if the method was invoked successfully, or empty if a problem was found.
-
getDescription
protected java.lang.String getDescription()
Describe the location/context of this script. Used for error messages
-
logWarn
protected void logWarn(java.lang.String message, java.lang.Throwable error)
-
py2qualified
public static QualifiedValue py2qualified(org.python.core.PyObject object)
-
-