Skip to main content

Pentaho+ documentation is moving!

The new product documentation portal is here. Check it out now at docs.hitachivantara.com

 

Hitachi Vantara Lumada and Pentaho Documentation

Value

pentaho.type. Value

The base, abstract class of instances which are the value of properties.

A Value has a key that uniquely identifies the entity it represents.

AMD Module

require(["pentaho/type/Value"], function(Value) { /* code goes here */ });

See also: pentaho.type.spec.IValue , pentaho.type.spec.IValueType

Extends

Implements

Constructor

Name Description
new Value(spec)
Abstract

Creates a Value instance.

Members

Name Description
$isValid :  boolean

Determines if this value is a valid.

$key :  string

Gets the key of the value.

$type :  pentaho.type.ValueType

Gets the type of this instance.

Methods

Name Description
_configure(config)
Protected

Configures this value with a given distinct and non-Nully configuration.

_equals(other) : boolean
Protected

Gets a value that indicates if a given distinct, non-null value of the same type represents the same entity.

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

clone() : pentaho.type.Value
Abstract

Creates a shallow clone of this value.

configure(config)

Configures this value with a given configuration.

equals(other) : boolean

Determines if a given value represents the same entity.

equalsContent(other) : boolean

Gets a value that indicates if a given equal value has the same content as this one.

toJSON() : JsonValue

Creates a top-level JSON specification that describes this instance.

toSpec(keyArgs) : pentaho.type.spec.Instance

Creates a specification that describes this value.

toSpecInContext(keyArgs) : *
Abstract

Creates a specification that describes this instance.

validate() : Array.<pentaho.type.ValidationError>

Determines if this value is valid.

Constructor Details

new Value(spec)
Abstract

Creates a Value instance.

Source: javascript/web/pentaho/type/Value.js, line 47

Parameters:
Name Default Value Summary
spec : pentaho.type.spec.Value
Optional

A value specification.

See also: pentaho.type.spec.IValue , pentaho.type.spec.IValueType

Members Details

$isValid:  boolean

Determines if this value is a valid.

This attribute calls validate and returns a boolean value indicating if it returned no errors.

Source: javascript/web/pentaho/type/Value.js, line 168

$key:  string

Gets the key of the value.

The key of a value must identify it among values of the same concrete type. Two values of the same concrete type and with the same key represent the same entity.

If two values have the same concrete type and their keys are equal, then it must also be the case that pentaho.type.Value#equals returns true. The opposite should be true as well. If two values of the same concrete type have distinct keys, then it must be the case that pentaho.type.Value#equals returns false.

The default implementation returns the result of calling toString().

Source: javascript/web/pentaho/type/Value.js, line 89

See also: pentaho.type.Value#equals

$type:  pentaho.type.ValueType

Gets the type of this instance.

Source: javascript/web/pentaho/type/Value.js, line 334

Overrides: pentaho.type.Instance#$type

Methods Details

_configure(config)
Protected

Configures this value with a given distinct and non-Nully configuration.

This method can only be called when there is an ambient transaction.

The default implementation throws an error if this value's type is read-only.

Source: javascript/web/pentaho/type/Value.js, line 264

Parameters:
Name Default Value Summary
config : *

The distinct, non-Nully configuration.

Throws:
Name Description
TypeError

When the value would be changed and its type is read-only.

See also: pentaho.type.Value#configure , pentaho.type.Complex#_configure , pentaho.type.List#_configure

_equals(other) : boolean
Protected

Gets a value that indicates if a given distinct, non-null value of the same type represents the same entity.

The default implementation considers two values equal if they have the equal keys.

Source: javascript/web/pentaho/type/Value.js, line 135

Parameters:
Name Default Value Summary
other : pentaho.type.Value

A distinct value to test for equality.

Returns:
Name Description
boolean

true if the given value is equal to this one; false, otherwise.

See also: pentaho.type.Value#equals , pentaho.type.Value#$key

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

This method calls the validate method.

Source: javascript/web/pentaho/type/Value.js, line 202

Throws:
Name Description
pentaho.type.ValidationError

When the value is not valid, the first error returned by the validate method.

clone() : pentaho.type.Value
Abstract

Creates a shallow clone of this value.

Source: javascript/web/pentaho/type/Value.js, line 93

Returns:
Name Description
pentaho.type.Value

The value clone.

Implements:
configure(config)

Configures this value with a given configuration.

This method ensures a transaction exists and then delegates to _configure.

For more information on the semantics of configuration, see Complex#_configure and List#_configure.

Source: javascript/web/pentaho/type/Value.js, line 232

Parameters:
Name Default Value Summary
config : *

The value configuration.

Throws:
Name Description
TypeError

When the value would be changed and its type is read-only.

See also: pentaho.type.Element#configureOrCreate , pentaho.type.Complex#_configure , pentaho.type.List#_configure

equals(other) : boolean

Determines if a given value represents the same entity.

This method checks if the given value is identical to this one. Otherwise, if not Nully and has the same constructor, execution is delegated to this value's _equals method.

Source: javascript/web/pentaho/type/Value.js, line 116

Parameters:
Name Default Value Summary
other : pentaho.type.Value

A value to test for equality.

Returns:
Name Description
boolean

true if the given value is equal to this one; or, false, otherwise.

See also: pentaho.type.Value#_equals

equalsContent(other) : boolean

Gets a value that indicates if a given equal value has the same content as this one.

This method must only be called if the equals method returns true.

The default implementation returns false.

Source: javascript/web/pentaho/type/Value.js, line 152

Parameters:
Name Default Value Summary
other : pentaho.type.Value

An equal value to test for content-equality.

Returns:
Name Description
boolean

true if the given value is equal in content to this one; false, otherwise.

See also: pentaho.type.Value#equals

toJSON() : JsonValue

Creates a top-level JSON specification that describes this instance.

Attributes which do not have a JSON-compatible specification are omitted. Specifically, for inline types, attributes with a function value are not supported.

This method simply calls pentaho.type.Instance#toSpec with argument keyArgs.isJson as true and exists for seamless integration with JavaScript's JSON.stringify method.

Source: javascript/web/pentaho/type/Instance.js, line 198

Inherited From: pentaho.type.Instance#toJSON

Returns:
Name Description
JsonValue | null

A JSON-compatible specification.

See also: pentaho.type.Instance#toSpec

Implements:
toSpec(keyArgs) : pentaho.type.spec.Instance

Creates a specification that describes this value.

If an ambient specification context, currently exists, it is used to manage the serialization process. Otherwise, one is created and set as current. Then, the actual work is delegated to pentaho.type.Instance#toSpecInContext.

Source: javascript/web/pentaho/type/Value.js, line 272

Overrides: pentaho.type.Instance#toSpec

Parameters:
Name Default Value Summary
keyArgs : object
Optional

The keyword arguments object. Passed to every value and type serialized within this scope.

Please see the documentation of value subclasses for information on additional, supported keyword arguments.

Parameters:
Name Default Value Summary
isJson : boolean
Optional
false

Generates a JSON-compatible specification. Attributes which do not have a JSON-compatible specification are omitted.

declaredType : pentaho.type.Type
Optional

The base type of this value's storage location. If the value does not have this exact type, its inline type property must be included in the specification. Otherwise, it can be omitted. When unspecified, the inline type property is only included if forceType is true.

forceType : boolean
Optional
false

Forces inclusion of the inline type property, _, in the specification.

omitFormatted : boolean
Optional
false

Omits the formatted value on Simple values' specifications.

preferPropertyArray : boolean
Optional
false

Indicates that, if possible, array form is used for Complex values' specifications.

The array form of a complex value cannot be used when its type must be inlined.

includeDefaults : boolean
Optional
false

When true, all of the properties of Complex values are serialized. When false, the default, only properties whose value is different from their default value are serialized.

Only applies to complex values that are serialized in object form. In array form, all of the properties of complex values are serialized independently of their value.

omitProps : object
Optional

An object whose own property names with a truthy value are the names of the properties of the current complex type to omit from the serialization.

Only applies when a complex is output in object form. In array form, all properties are output whatever their value.

This argument only applies to complex values and is not passed through to the values of their properties.

Returns:
Name Description
pentaho.type.spec.Instance | null

A specification of this value.

toSpecInContext(keyArgs) : *
Abstract

Creates a specification that describes this instance.

Source: javascript/web/pentaho/type/Instance.js, line 178

Inherited From: pentaho.type.Instance#toSpecInContext

Parameters:
Name Default Value Summary
keyArgs : object
Optional

The keyword arguments' object. Passed to every instance and type serialized within this scope.

Please see the documentation of subclasses for information on additional, supported keyword arguments.

Returns:
Name Description
*

A specification of this instance.

See also: pentaho.type.Instance#toSpec

validate() : Array.<pentaho.type.ValidationError>

Determines if this value is valid.

The default implementation does nothing and considers the instance valid. Override to implement a type's specific validation logic.

You can use the error utilities in pentaho.type.Util to help in the implementation.

Source: javascript/web/pentaho/type/Value.js, line 187

Returns:
Name Description
Array.<pentaho.type.ValidationError>

A non-empty array of errors or null.

See also: pentaho.type.Value#$isValid