com.servoy.j2db.scripting
Class FunctionDefinition
java.lang.Object
com.servoy.j2db.scripting.FunctionDefinition
public class FunctionDefinition
- extends Object
Function definition, use to retrieve form and method name from a javascript Function object
This class should be used to hold on to function objects in plugins that are later called by using the method
execute(IClientPluginAccess, Object[], boolean) which is a short cut to IClientPluginAccess.executeMethod(String, String, Object[], boolean)
FunctionDefinition
public FunctionDefinition()
FunctionDefinition
public FunctionDefinition(org.mozilla.javascript.Function f)
FunctionDefinition
public FunctionDefinition(String methodString)
- Create FunctionDefinition from [formname|globals].method string.
- Parameters:
methodString - - Since:
- 5.0
FunctionDefinition
public FunctionDefinition(String formName,
String methodName)
execute
public Object execute(IClientPluginAccess access,
Object[] arguments,
boolean async)
- Helper method that calls the
IClientPluginAccess.executeMethod(String, String, Object[], boolean) for you with the right formname/context and
method name. And exception that IClientPluginAccess.executeMethod(String, String, Object[], boolean) will throw will be catched and IClientPluginAccess.handleException(String, Exception)
will be called with the Exception object. If you want the exception object call IClientPluginAccess.executeMethod(String, String, Object[], boolean) directly.
- Parameters:
access - The IClientPluginAccess object to callarguments - The arguments to give to the method callsasync - Should the call happen in async (if true the method returns null)
- Returns:
- The object that the method returns or null if async is true.
exists
public FunctionDefinition.Exist exists(IClientPluginAccess access)
- Test if the given methodName or formName do exist. Will return one of the
FunctionDefinition.Exist enums.
getFormName
public String getFormName()
getMethodName
public String getMethodName()
setFormName
public void setFormName(String formName)
setMethodName
public void setMethodName(String methodName)
toMethodString
public String toMethodString()
toString
public String toString()
- Overrides:
toString in class Object