Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

RefinementFacet

pentaho.type.facets.RefinementFacet

A refinement facet provides a refinement type with attributes which, when specified, refine the representation type in some way.

Refinement facets are mixed into a pentaho.type.Refinement type, by specifying its pentaho.type.Refinement.Type#facets property, when defining it, either through pentaho.type.Value.refine or, directly through pentaho.type.Refinement.extend.

In addition to any attributes that you may define in this type's prototype, to enable configuring an actual refinement, you must implement the static pentaho.type.facets.RefinementFacet.validate method that will perform the actual validation of instances of the representation class. Note that this method is invoked on the mixed into refinement type, an instance of pentaho.type.Refinement.Type.

AMD Module

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

See also:  pentaho.type.Refinement , pentaho.type.Refinement.Type#facets

Constructor

Name Description
new RefinementFacet()
 
Abstract

The constructor is not used, as the class is to be used as a mixin.

Members

Name Description
id : nonEmptyString
 
Static

Gets the identifier of the refinement facet AMD module.

shortId : nonEmptyString
 
Static

Gets the short identifier of the refinement facet.

Methods

Name Description
fillSpecInContext(spec, keyArgs) : boolean
 
Static

Fills the given specification with the local values of the attributes that this refinement facet adds to a refinement type and returns whether any attribute was actually added.

validate(value) : pentaho.type.ValidationError | Array.<!pentaho.type.ValidationError> | null
 
Static

Performs validation of a given value of the representation type.

Constructor Details

new RefinementFacet()
 
Abstract

The constructor is not used, as the class is to be used as a mixin.

Source: javascript/web/pentaho/type/facets/Refinement.js, line 26

See also:  pentaho.type.Refinement , pentaho.type.Refinement.Type#facets

Members Details

id: nonEmptyString
 
Static

Gets the identifier of the refinement facet AMD module.

Source: javascript/web/pentaho/type/facets/Refinement.js, line 68

shortId: nonEmptyString
 
Static

Gets the short identifier of the refinement facet.

When a refinement facet is one of the standard facets and, thus, it is a direct sub-module of the pentaho/type/facets module, its short identifier is its local module id, like "DiscreteDomain" or "OrdinalDomain".

Otherwise, the short identifier is equal to the identifier.

Source: javascript/web/pentaho/type/facets/Refinement.js, line 84

See also:  pentaho.type.facets.RefinementFacet.id

Methods Details

fillSpecInContext(spec, keyArgs) : boolean
 
Static

Fills the given specification with the local values of the attributes that this refinement facet adds to a refinement type and returns whether any attribute was actually added.

This method requires that there currently exists an ambient specification context.

This method is invoked on the refinement type, an instance of pentaho.type.Refinement.Type.

Source: javascript/web/pentaho/type/facets/Refinement.js, line 124

Parameters:
Name Default Value Summary
spec : Object

The specification to be filled.

keyArgs : Object
 
Optional

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

Returns:
Name Description
boolean

true if any attribute was added; false, otherwise.

validate(value) : pentaho.type.ValidationError | Array.<!pentaho.type.ValidationError> | null
 
Static

Performs validation of a given value of the representation type.

This method is invoked on the refinement type, an instance of pentaho.type.Refinement.Type.

The default implementation throws an error.

Source: javascript/web/pentaho/type/facets/Refinement.js, line 103

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

The value to validate according to this refinement facet.

Returns:
Name Description
pentaho.type.ValidationError | Array.<!pentaho.type.ValidationError> | null

An error, a non-empty array of errors or null.