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

Base

pentaho.lang Base

Base Class for JavaScript Inheritance.

Based on Generic.js by Dean Edwards, and later edited by Kenneth Powers.

AMD Module

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

Constructor

Name Description
new Base(spec)

Creates a new Base object.

Classes

Name Summary
Array
Error
Object

Members

Name Description
ancestor
Static

The ancestor class.

base : function
Protected

If a method has been overridden, then the base method provides access to the overridden method.

Methods

Name Description
_extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>
Protected

Actually creates a subclass of this one.

_subclassed(Subclass, instSpec, classSpec, keyArgs)
Protected

Called when a subclass of this class has been created.

extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>

Creates a subclass of this one.

implement(instSpecs) : Class.<pentaho.lang.Base>

Adds instance specifications to this class.

implementStatic(classSpecs) : Class.<pentaho.lang.Base>

Adds static specifications to this class.

mix(instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>

Adds additional members to, or overrides existing ones of, this class.

to(value, other) : pentaho.lang.Base

Converts a value to an instance of this class, or throws if that is impossible.

extend(source, keyArgs) : object

Extend an object with the properties of another.

Constructor Details

new Base(spec)

Creates a new Base object.

If spec is specified, the new object is extended with it.

Source: javascript/web/pentaho/lang/Base.js, line 132

Parameters:
Name Default Value Summary
spec : object
Optional

An extension specification.

Members Details

ancestor:
Static

The ancestor class.

Source: javascript/web/pentaho/lang/Base.js, line 287

base: function
Protected

If a method has been overridden, then the base method provides access to the overridden method.

Can also be called from within a constructor function.

Source: javascript/web/pentaho/lang/Base.js, line 299

Methods Details

_extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>
Protected

Actually creates a subclass of this one.

The default implementation creates the subclass constructor, inherits static members and handles the special instSpec.extend_exclude and instSpec.extend_order properties. Then, it delegates the remainder of the subclass setup to the _subclassed, whose default implementation mixes-in the given instance and class specifications.

Source: javascript/web/pentaho/lang/Base.js, line 425

Parameters:
Name Default Value Summary
name : string

The name of the created class.

instSpec : object | undefined

The instance-side specification.

Parameters:
Name Default Value Summary
extend_order : Array.<string>
Optional

An array of instance property names that extend should always apply before other properties and in the given order.

The given property names are appended to any inherited ordered property names.

extend_exclude : object
Optional

A set of property names to exclude, whenever the instance side of the class (through mix or implement) or its instances (through extend) are extended.

The given property names are joined with any inherited excluded property names.

Properties can have any value.

classSpec : object | undefined

The class-side specification.

keyArgs : object | undefined

The keyword arguments.

Returns:
Name Description
Class.<pentaho.lang.Base>

The new subclass.

_subclassed(Subclass, instSpec, classSpec, keyArgs)
Protected

Called when a subclass of this class has been created.

The default implementation mixes the given instance and class specification in the new subclass, without actually recording a mix operation.

Source: javascript/web/pentaho/lang/Base.js, line 564

Parameters:
Name Default Value Summary
Subclass : function

The created subclass.

instSpec : object | undefined

The instance-side specification.

classSpec : object | undefined

The static-side specification.

keyArgs : object | undefined

The keyword arguments.

extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>

Creates a subclass of this one.

All classes inherit the extend method, so they can also be subclassed.

Inheritance is delegated to the _extend method, which can be overridden.

Source: javascript/web/pentaho/lang/Base.js, line 369

Parameters:
Name Default Value Summary
name : string
Optional

The name of the created class. Used for debugging purposes.

instSpec : object
Optional

The instance specification.

Parameters:
Name Default Value Summary
extend_order : Array.<string>
Optional

An array of instance property names that extend should always apply before other properties and in the given order.

The given property names are appended to any inherited ordered property names.

extend_exclude : object
Optional

A set of property names to exclude, whenever the instance side of the class (through mix or implement) or its instances (through extend) are extended.

The given property names are joined with any inherited excluded property names.

Properties can have any value.

classSpec : object
Optional

The static specification.

keyArgs : object
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : object
Optional

A set of property names to exclude, both from the instance and class sides, in this method call. Properties can have any value.

Returns:
Name Description
Class.<pentaho.lang.Base>

The new subclass.

implement(instSpecs) : Class.<pentaho.lang.Base>

Adds instance specifications to this class.

This method does not create a new class.

Each instance specification can be a class or an object. When it is a class, only its instance-side is mixed-in.

Source: javascript/web/pentaho/lang/Base.js, line 898

Parameters:
Name Default Value Summary
instSpecs : function | Object

The instance-side specifications to mix-in.

Returns:
Name Description
Class.<pentaho.lang.Base>

This class.

See also: pentaho.lang.Base.implementStatic , pentaho.lang.Base.mix

implementStatic(classSpecs) : Class.<pentaho.lang.Base>

Adds static specifications to this class.

This method does not create a new class.

Each class-side/static specification can be a class or an object. When it is a class, only its class-side is mixed-in.

Source: javascript/web/pentaho/lang/Base.js, line 946

Parameters:
Name Default Value Summary
classSpecs : function | object | Nully
Repeatable

The class-side specifications to mix-in.

Returns:
Name Description
Class.<pentaho.lang.Base>

This class.

mix(instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>

Adds additional members to, or overrides existing ones of, this class.

This method does not create a new class.

This method supports two signatures:

  1. mix(Class: function[, keyArgs: Object]) - mixes-in the given class, both its instance and class sides.

  2. mix(instSpec: Object[, classSpec: Object[, keyArgs: Object]]) - mixes-in the given instance and class side specifications.

Source: javascript/web/pentaho/lang/Base.js, line 745

Parameters:
Name Default Value Summary
instSpec : function | Object

The class to mixin or the instance-side specification.

classSpec : object
Optional

The class-side specification.

keyArgs : object
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : object
Optional

A set of property names to exclude, both from the instance and class sides. Properties can have any value.

Returns:
Name Description
Class.<pentaho.lang.Base>

This class.

to(value, other) : pentaho.lang.Base

Converts a value to an instance of this class, or throws if that is impossible.

When value is an instance of this type, it is returned.

Otherwise, a new instance of this class is created, using all of the specified arguments as constructor arguments.

Source: javascript/web/pentaho/lang/Base.js, line 676

Parameters:
Name Default Value Summary
value : *

The value to be cast.

other : *
Repeatable

Remaining arguments passed alongside value to the class constructor.

Returns:
Name Description
pentaho.lang.Base

The converted value.

Throws:
Name Description
Error

When value cannot be converted.

extend(source, keyArgs) : object

Extend an object with the properties of another.

Methods that are overridden are accessible through this.base.

This object is extended, but its class doesn't change.

Source: javascript/web/pentaho/lang/Base.js, line 1040

Parameters:
Name Default Value Summary
source : object

The instance specification.

keyArgs : object
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : object
Optional

A map of property names to exclude from source.

Returns:
Name Description
object

This object.