function
public java.lang.Object function(java.lang.Object[] arguments)
Subclasses should override this method. This method is invoked when
the receiver's function is called from javascript. If all of the
arguments that are passed to the javascript function call are of
supported types then this method is invoked with the argument values
converted as follows:
javascript null or undefined -> null
javascript number -> java.lang.Double
javascript string -> java.lang.String
javascript boolean -> java.lang.Boolean
javascript array whose elements are all of supported types -> java.lang.Object[]
If any of the javascript arguments are of unsupported types then the
function invocation will fail and this method will not be called.
This method must return a value with one of these supported java types to
the javascript caller. Note that null
values are converted
to javascript's null
value (not undefined
), and
instances of any java.lang.Number
subclass will be converted
to a javascript number.
- Overrides:
function
in class BrowserFunction
- Parameters:
arguments
- the javascript arguments converted to java equivalents
- Returns:
- the value to return to the javascript caller