$k. ChoiceRange

new ChoiceRange()

Represents the value range of a choice attribute

Extends

Methods

choiceInternalNamed(internalName) → {$k.Choice}

Returns the choice with the internal name

Parameters:
NameTypeDescription
internalNamestring

The internal name of the choice

Throws:

If there is no such choice

Type
$k.exception.SchemaError
Returns:
Type: 
$k.Choice

choices() → {Array.<$k.Choice>}

Returns the possible choices

Returns:
Type: 
Array.<$k.Choice>

parse(string, languageopt)

Parse the string representation and returns the converted value

Parameters:
NameTypeAttributesDescription
stringstring

The string represantation of the value that should be set.

languagestring<optional>

Language of the value. Either ISO 639-1 (2-letter code, e.g. "en") or ISO 639-2B (3-letter code, e.g. "eng"). If not defined, the current language will be used. Ignored if the attribute is not translated

Inherited From
Throws:

If the string is not in the range of allowed values of the attribute

Type
$k.exception.InvalidValue
Returns:

The converted value

valueToString(value, languageopt) → {string}

Returns the string representation of the value

Parameters:
NameTypeAttributesDescription
valuestring

The value that should be converted

languagestring<optional>

Language of the value. Either ISO 639-1 (2-letter code, e.g. "en") or ISO 639-2B (3-letter code, e.g. "eng"). If not defined, the current language will be used. Ignored if the attribute is not translated

Throws:

If the value is not in the range of allowed values of the attribute

Type
$k.exception.InvalidValue
Returns:
Type: 
string

valueType() → {string}

Returns a string describing the value type.

One of

  • blob
  • boolean
  • choice
  • color
  • container
  • date
  • dateAndTime
  • flexTime
  • float
  • geoPosition
  • integer
  • interval
  • password
  • registyEntry
  • string
  • time
  • translatedAttribute
  • translation
  • url
Returns:
Type: 
string