The MetaObject class is an object that processes metadata by implementing IOobject and IMarshal interfaces.

Hierarchy (view full)

Implements

Constructors

  • Creates an instance of the MetaObject class.

    Returns MetaObject

Properties

_guid: string

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

_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.

_UNION: []

List of implemented interfaces.

[IObject, IMarshal]

Methods

  • 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.

    @param{number} [vOpt=0] - 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)

    Parameters

    • OptionalvOpt: number
    • Optionalowned: object | object[]

    Returns object

    const serializedObj = a.getObject(2);
    const isEqual = JSON.stringify(serializedObj) === JSON.stringify(b.getObject(2));
  • 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
    • Optionalorigin: object

    Returns any

    • serialized object. @param{object} [origin=p_oGuid] - Original object. Default is 'oGuid'.