new $k.AttributeType()
Represents a type of attributes
Extends
Methods
addTranslatedLanguage()
adds the language to the set of possible translations for this attribute
Throws:
Type | Description |
---|---|
$k.exception.InvalidLanguage | If an invalid language was specified |
$k.exception.TransactionError | If no write transaction is active |
elementAtValue(value, language) : $k.SemanticElement
Returns the semantic element with an attribute of this type with the specified value, or undefined if there is either no such attribute or more than one
Name | Type | Description |
---|---|---|
value |
string |
The value to search for |
language |
string |
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. |
Throws:
Type | Description |
---|---|
$k.exception.InvalidValue | If the value is not in the range of allowed values of the attribute |
Returns:
Type | Description |
---|---|
$k.SemanticElement |
elementsAtValue(value, language) : Array.<$k.SemanticElement>
Returns all semantic elements with attributes of this types with the specified value
Name | Type | Description |
---|---|---|
value |
string |
The value to search for |
language |
string |
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. |
Throws:
Type | Description |
---|---|
$k.exception.InvalidValue | If the value is not in the range of allowed values of the attribute |
Returns:
Type | Description |
---|---|
Array.<$k.SemanticElement> |
hasTranslatedValues() : boolean
True if the attributes have translated values
Returns:
Type | Description |
---|---|
boolean |
translatedLanguages() : Array.<string>
Returns the possible translated languages as 3-letter codes (ISO639 2b).
Empty if the attribute is not translated
Returns:
Type | Description |
---|---|
Array.<string> |
valueRange() : $k.ValueRange
Returns the range of the values of the attributes
Returns:
Type | Description |
---|---|
$k.ValueRange |