JavaScriptFunctionBinding Class

public final class JavaScriptFunctionBinding
extends FunctionBinding

The binding to a JavaScript function.

Constructor Summary

Constructor Description
JavaScriptFunctionBinding()

Creates an instance of JavaScriptFunctionBinding class.

Method Summary

Modifier and Type Method and Description
static JavaScriptFunctionBinding fromJson(JsonReader jsonReader)

Reads an instance of JavaScriptFunctionBinding from the JsonReader.

String script()

Get the script property: The JavaScript code containing a single function definition.

JsonWriter toJson(JsonWriter jsonWriter)
String type()

Get the type property: Indicates the function binding type.

void validate()

Validates the instance.

JavaScriptFunctionBinding withScript(String script)

Set the script property: The JavaScript code containing a single function definition.

Methods inherited from FunctionBinding

Methods inherited from java.lang.Object

Constructor Details

JavaScriptFunctionBinding

public JavaScriptFunctionBinding()

Creates an instance of JavaScriptFunctionBinding class.

Method Details

fromJson

public static JavaScriptFunctionBinding fromJson(JsonReader jsonReader)

Reads an instance of JavaScriptFunctionBinding from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of JavaScriptFunctionBinding if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the JavaScriptFunctionBinding.

script

public String script()

Get the script property: The JavaScript code containing a single function definition. For example: 'function (x, y) { return x + y; }'.

Returns:

the script value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

JavaScriptFunctionBinding.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

type

public String type()

Get the type property: Indicates the function binding type.

Overrides:

JavaScriptFunctionBinding.type()

Returns:

the type value.

validate

public void validate()

Validates the instance.

Overrides:

JavaScriptFunctionBinding.validate()

withScript

public JavaScriptFunctionBinding withScript(String script)

Set the script property: The JavaScript code containing a single function definition. For example: 'function (x, y) { return x + y; }'.

Parameters:

script - the script value to set.

Returns:

the JavaScriptFunctionBinding object itself.

Applies to