Servoy 5.x Public API

com.servoy.j2db.scripting
Class FunctionDefinition

java.lang.Object
  extended by 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)


Nested Class Summary
static class FunctionDefinition.Exist
           
 
Constructor Summary
FunctionDefinition()
           
FunctionDefinition(org.mozilla.javascript.Function f)
           
FunctionDefinition(String methodString)
          Create FunctionDefinition from [formname|globals].method string.
FunctionDefinition(String formName, String methodName)
           
 
Method Summary
 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.
 FunctionDefinition.Exist exists(IClientPluginAccess access)
          Test if the given methodName or formName do exist.
 String getFormName()
           
 String getMethodName()
           
 void setFormName(String formName)
           
 void setMethodName(String methodName)
           
 String toMethodString()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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)
Method Detail

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 call
arguments - The arguments to give to the method calls
async - 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

Copyright © 2010 Servoy B.V.