Reference Source
public class | source

MetaModel

Metadata corresponding to an Entity that represents a model.

An Entity represents a model when Entity#isModel is true

A MetaModel corresponds to an Entity by having the same MetaModel#id as the Entity#id.

A MetaModel is created by MetaScene#createMetaModel and belongs to a MetaScene.

Each MetaModel is registered by MetaModel#id in MetaScene#metaModels.

A MetaModel represents its object structure with a tree of MetaObjects, with MetaModel#rootMetaObject referencing the root MetaObject.

Constructor Summary

Public Constructor
public

Creates a new, unfinalized MetaModel.

Member Summary

Public Members
public

The model author, if available.

public

The date the model was created, if available.

public

The application that created the model, if available.

public

True when this MetaModel has been finalized.

public

graph: {}

Connectivity graph.

public

Globally-unique ID.

public

The MetaObjects in this MetaModel, each mapped to its ID.

public

Metadata on the Scene.

public

The project ID

public

The PropertySets in this MetaModel.

public

The revision ID, if available.

public get

Backwards compatibility with the model having a single root MetaObject.

public

The root MetaObjects in this MetaModel's composition structure hierarchy.

public

The model schema version, if available.

Method Summary

Public Methods
public
public

getJSON(): {schema: String|string|*, createdAt: String|string|*, metaObjects: *[], author: String|string|*, id: String|Number|string|number|*, creatingApplication: String|string|*, projectId: String|Number|string|number|*, propertySets: *[]}

Gets this MetaModel as JSON.

public

loadData(metaModelData: *)

Load metamodel data into this MetaModel.

Public Constructors

public constructor() source

Creates a new, unfinalized MetaModel.

  • The MetaModel is immediately registered by MetaModel#id in MetaScene#metaModels, even though it's not yet populated.
  • The MetaModel then needs to be populated with one or more calls to metaModel#loadData.
  • As we populate it, the MetaModel will create MetaObjects and PropertySets in itself, and in the MetaScene.
  • When populated, call MetaModel#finalize to finish it off, which causes MetaScene to fire a "metaModelCreated" event.

Public Members

public author: String source

The model author, if available.

Will be undefined if not available.

Properties:

NameTypeAttributeDescription
author *

public createdAt: String source

The date the model was created, if available.

Will be undefined if not available.

Properties:

NameTypeAttributeDescription
createdAt *

public creatingApplication: String source

The application that created the model, if available.

Will be undefined if not available.

Properties:

NameTypeAttributeDescription
creatingApplication *

public finalized: boolean source

True when this MetaModel has been finalized.

public graph: {} source

Connectivity graph.

public id: String | Number source

Globally-unique ID.

MetaModels are registered by ID in MetaScene#metaModels.

When this MetaModel corresponds to an Entity then this ID will match the Entity#id.

Properties:

NameTypeAttributeDescription
id *

public metaObjects: MetaObject[] source

The MetaObjects in this MetaModel, each mapped to its ID.

Properties:

NameTypeAttributeDescription
metaObjects *

public metaScene: MetaScene source

Metadata on the Scene.

Properties:

NameTypeAttributeDescription
metaScene *

public projectId: String | Number source

The project ID

Properties:

NameTypeAttributeDescription
projectId *

public propertySets: PropertySet[] source

The PropertySets in this MetaModel.

Properties:

NameTypeAttributeDescription
propertySets *

public revisionId: String | Number source

The revision ID, if available.

Will be undefined if not available.

Properties:

NameTypeAttributeDescription
revisionId *

public get rootMetaObject: MetaObject | null source

Backwards compatibility with the model having a single root MetaObject.

Properties:

NameTypeAttributeDescription
rootMetaObject *

public rootMetaObjects: MetaObject[] source

The root MetaObjects in this MetaModel's composition structure hierarchy.

Properties:

NameTypeAttributeDescription
rootMetaObject *

public schema: String source

The model schema version, if available.

Will be undefined if not available.

Properties:

NameTypeAttributeDescription
schema *

Public Methods

public finalize() source

public getJSON(): {schema: String|string|*, createdAt: String|string|*, metaObjects: *[], author: String|string|*, id: String|Number|string|number|*, creatingApplication: String|string|*, projectId: String|Number|string|number|*, propertySets: *[]} source

Gets this MetaModel as JSON.

Return:

{schema: String|string|*, createdAt: String|string|*, metaObjects: *[], author: String|string|*, id: String|Number|string|number|*, creatingApplication: String|string|*, projectId: String|Number|string|number|*, propertySets: *[]}

public loadData(metaModelData: *) source

Load metamodel data into this MetaModel.

Params:

NameTypeAttributeDescription
metaModelData *