Class: FunctionParameter

(abstract) FunctionParameter(optionsopt)

(abstract) new FunctionParameter(optionsopt)

A parameter to a CatalogFunction.

Parameters:
Name Type Attributes Description
options Object <optional>

Object with the following properties:

Properties
Name Type Attributes Description
terria Terria

The Terria instance.

catalogFunction CatalogFunction

The function that this is a parameter to.

id String

The unique ID of this parameter.

name String <optional>

The name of this parameter. If not specified, the ID is used as the name.

description String <optional>

The description of the parameter.

isRequired Boolean <optional>

True if this parameter is required, false if it is optional.

value Object <optional>

The initial value of the parameter.

Source:

Members

_defaultValue

Gets the default value for this parameter, or undefined if there is no default value.

Source:

availableFormatters

Gets the formatters that are available to format the parameter's value.

Source:

catalogFunction :CatalogFunction

Gets the function to which this is a parameter.

Type:
Source:

converter :Any

A converter that can be used to convert this parameter for use with a CatalogFunction. The actual type and content of this property is defined by the catalog function.

Type:
  • Any
Source:

defaultValue :*

Gets the default value for this parameter, or undefined if there is no default value.

Type:
  • *
Source:

description :String

Gets or sets the description of the parameter.

Type:
  • String
Source:

formatter :String

Gets or sets the formatter (from the set defined by FunctionParameter#availableFormatters) to use to format this parameter to pass to the CatalogFunction.

Type:
  • String
Source:

id :String

Gets the ID of the parameter.

Type:
  • String
Source:

isLoading :Boolean

Gets or sets a value indicating whether the parameter is currently loading. This property is observable.

Type:
  • Boolean
Source:

isRequired :Boolean

Gets or sets a value indicating whether this parameter is required.

Type:
  • Boolean
Default Value:
  • false
Source:

name :String

Gets or sets the name of the parameter.

Type:
  • String
Source:

terria :Terria

Gets the Terria instance associated with this parameter.

Type:
Source:

type :String

Gets the type of this parameter.

Type:
  • String
Source:

value :*

Gets or sets the current value of this parameter.

Type:
  • *
Source:

value

Gets or sets the current value of this parameter.

Source:

Methods

formatForService(valueopt) → {Any}

Formats this value to pass to a service. The format is controlled by the FunctionParameter#formatter property.

Parameters:
Name Type Attributes Description
value Object <optional>

Value to format as string. If not specified, FunctionParameter#value is used.

Source:
Returns:

The formatted value.

Type
Any

formatValueAsString(valueopt) → {String}

Represents value as string.

Parameters:
Name Type Attributes Description
value Object <optional>

Value to format as string. If not specified, FunctionParameter#value is used.

Source:
Returns:

String representation of the value.

Type
String

serializeToJson() → {Object}

Serializes the data item to JSON.

Source:
Returns:

The serialized JSON object-literal.

Type
Object

updateFromJson(json) → {Promise}

Updates the function parameter from a JSON object-literal description of it.

Parameters:
Name Type Description
json Object

The JSON description. The JSON should be in the form of an object literal, not a string.

Source:
Returns:

A promise that resolves when the update is complete.

Type
Promise