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.ObjectHelper 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.Stringsignature
-
Constructor Summary
Constructors Modifier Constructor Description protectedScriptFunctionHelper(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 PerspectiveElementgetComponent()protected java.lang.StringgetDescription()Describe the location/context of this script.protected LoggerExgetLog()java.util.Optional<org.python.core.PyObject>invoke(org.python.core.PyObject... arguments)protected voidlogWarn(java.lang.String message, java.lang.Throwable error)voidonScriptLibraryChange(ScriptLibChangeEvent event)static QualifiedValuepy2qualified(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)
-
-