Class ExtensionFunction
java.lang.Object
com.inductiveautomation.vision.api.client.components.model.ExtensionFunction
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanstatic <T> Tinvoke(ExtensibleComponent self, LoggerEx log, String methodName, Class<T> returnType, T defaultValue, Object... args) Helper function to invoke an extension function.static booleanisDefined(ExtensibleComponent self, String methodName) Tests whether the given extensible component has an enabled extension function for the given method nameboolean
- 
Constructor Details- 
ExtensionFunction
 
- 
- 
Method Details- 
isEnabledpublic boolean isEnabled()
- 
getScript
- 
equals
- 
isDefinedTests whether the given extensible component has an enabled extension function for the given method name
- 
invokepublic static <T> T invoke(ExtensibleComponent self, LoggerEx log, String methodName, Class<T> returnType, T defaultValue, Object... args) Helper function to invoke an extension function.- Parameters:
- self- The component that is invoking
- log- A logger to log any errors to. This function never throws an exception. Any problems are logged to this logger and the default will be returned.
- methodName- The name of the extension function. Must match the associated ExtensionFunctionDescriptor's method name.
- returnType- The type to coerce the script's return value into. For functions that don't need to return anything, use Void.class
- defaultValue- The default return value. This will be returned if this extension function isn't implemented on self.
- args- Arguments to pass to the function.
- Returns:
- whatever value the extensible function returned, or defaultValue if there was no extension function defined
 
 
-