Top Description Methods
com.dlsc.gmapsfx.javascript

public Interface IJavascriptRuntime

Known Direct Implementers
com.dlsc.gmapsfx.javascript.JavascriptRuntime
Imports
netscape.javascript.JSObject

An interface for interacting with a JavaScript environment which includes methods for building strings that represent functions and constructors as well as providing a means to execute commands.
Author
Rob Terpilowski

Method Summary

Modifier and TypeMethod and Description
public JSObject

Returns:

The underlying JavaScript object that was returned by the script.
execute
(String
The JavaScript command to execute
command
)
References Deprecated JSObject is deprecated or references (maybe indirectly) at least one deprecated element.

Execute the specified command returning a value (if any)

public String

Returns:

A string which can be passed to the JavaScript environment to create a new array.
getArrayConstructor
(String
type The type of JavaScript object array to create
javascriptObjectType
,
Object[]
The array elements
ary
)

Gets an array parameter constructor as a String, which then can be passed to the execute() method.

public String

Returns:

A string which can be passed to the JavaScript environment to invoke the function
getArrayFunction
(String
The function to invoke
function
,
Object[]
The array of arguments to pass to the function.
ary
)

Gets an array function as a String, which then can be passed to the execute() method.

public String

Returns:

A string which can be passed to the JavaScript environment to create a new object.
getConstructor
(String
The type of JavaScript object to create
javascriptObjectType
,
Object...
The args of the constructor
args
)

Gets a constructor as a string which then can be passed to the execute().

public String

Returns:

A string which can be passed to the JavaScript environment to invoke the function
getFunction
(String
The variable to invoke the function on.
variable
,
String
The function to invoke
function
,
Object...
Arguments the function requires
args
)

Gets a function as a String, which then can be passed to the execute() method.

public String

Returns:

A string which can be passed to the JavaScript environment to invoke the function
getFunction
(String
The function to invoke
function
,
Object...
Arguments the function requires
args
)

Gets a function as a String, which then can be passed to the execute() method.

Method Detail

executeback to summary
public JSObject execute(String command)

References Deprecated

JSObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Execute the specified command returning a value (if any)

Parameters
command:String

The JavaScript command to execute

Returns:JSObject

The underlying JavaScript object that was returned by the script.

getArrayConstructorback to summary
public String getArrayConstructor(String javascriptObjectType, Object[] ary)

Gets an array parameter constructor as a String, which then can be passed to the execute() method. Note, this is where the parameter to the constructor is an array, rather than the varargs which are broken down into separate parameters.

Parameters
javascriptObjectType:String

type The type of JavaScript object array to create

ary:Object[]

The array elements

Returns:String

A string which can be passed to the JavaScript environment to create a new array.

getArrayFunctionback to summary
public String getArrayFunction(String function, Object[] ary)

Gets an array function as a String, which then can be passed to the execute() method.

Parameters
function:String

The function to invoke

ary:Object[]

The array of arguments to pass to the function.

Returns:String

A string which can be passed to the JavaScript environment to invoke the function

getConstructorback to summary
public String getConstructor(String javascriptObjectType, Object... args)

Gets a constructor as a string which then can be passed to the execute().

Parameters
javascriptObjectType:String

The type of JavaScript object to create

args:Object[]

The args of the constructor

Returns:String

A string which can be passed to the JavaScript environment to create a new object.

getFunctionback to summary
public String getFunction(String variable, String function, Object... args)

Gets a function as a String, which then can be passed to the execute() method.

Parameters
variable:String

The variable to invoke the function on.

function:String

The function to invoke

args:Object[]

Arguments the function requires

Returns:String

A string which can be passed to the JavaScript environment to invoke the function

getFunctionback to summary
public String getFunction(String function, Object... args)

Gets a function as a String, which then can be passed to the execute() method.

Parameters
function:String

The function to invoke

args:Object[]

Arguments the function requires

Returns:String

A string which can be passed to the JavaScript environment to invoke the function