The MetaElement class inherits the MetaObject and implements the IElement interface.
Represents the elements that represent the metadata.

Hierarchy (view full)

Implements

Constructors

  • Creates an instance of the MetaElement class.

    Parameters

    • name: string

      The name of the element

    Returns MetaElement

Properties

_guid: string

Unique identifier of the object (GUID). Uniquely identifies the object.

_name: string

The name of the element, which acts as a unique identifier for the MetaElement.

_type: Function

The generator function of the object. The function used when the object was created.

_NS: string

Indicates the namespace.

'Meta'
_PARAM: []

List of parameters used for the constructor.

['name']
_UNION: []

List of implemented interfaces.

[IElement]

Methods

  • Replicate the current object.

    Parameters

    • Rest...args: any[]

      Additional argument to be used for replication.

    Returns this

    Returns a replicated object.

  • Compare the current object with the specified object.

    Parameters

    • target: object

      the object to be compared to.

    Returns boolean

    Returns whether the two objects are the same.

  • Returns the current object as a serialized object. Serialization replaces cyclic references with values of '$ref', and depending on the serialization options, you can select reference structures, redundant structures, and non-contrast structures.

    Parameters

    • OptionalvOpt: number

      Serialization option. Default is '0'.

      • 0: Reference structure (_guid: Yes, $ref: Yes)
      • 1: Redundant structure (_guid: Yes, $ref: Yes)
      • 2: Non-tidal rescue (_guid: no, $ref: no)
    • Optionalowned: object | object[]

    Returns object

    serialized object.

    const serializedObj = element.getObject(2);
    console.log(serializedObj); // serialized object output
  • Returns the creators of the current object and all the creators of the prototype chain to the array.

    Returns Function[]

    Returns the array of generator functions.

    const types = obj.getTypes();
    console.log(types); // [Function: MetaObject]
  • Verify that the current object is an instance of the specified type (including _UNION)

    Parameters

    • target: string | object

      The type of object to be checked (object or string).

    Returns boolean

    Returns whether it is an instance of the specified type.

  • Initialize the current object using the serialized object. In this process, the object is initialized, and the state of the object is restored based on the serialized object (oGuid).

    Parameters

    • oGuid: object

      serialized object.

    • Optionalorigin: object

      Original object. Default is 'oGuid'.

    Returns any