ModelFile (Common API)

Overview - Common API - Client API - Admin API - Runtime API

ModelFile

Class representing a Model File. A Model File contains a single namespace and a set of model elements: assets, transactions etc.

Details

  • Module common

See also

Method Summary

Name Returns Description
getAllDeclarations ClassDeclaration[] Get all declarations in this ModelFile
getAssetDeclaration AssetDeclaration Get the AssetDeclarations defined in this ModelFile or null
getAssetDeclarations AssetDeclaration[] Get the AssetDeclarations defined in this ModelFile
getConceptDeclarations ConceptDeclaration[] Get the ConceptDeclarations defined in this ModelFile
getDeclarations ClassDeclaration[] Get the instances of a given type in this ModelFile
getDefinitions string Get the definitions for this model
getEnumDeclarations EnumDeclaration[] Get the EnumDeclarations defined in this ModelFile
getEventDeclaration EventDeclaration Get the EventDeclaration defined in this ModelFile or null
getEventDeclarations EventDeclaration[] Get the EventDeclarations defined in this ModelFile
getImports string[] Returns the types that have been imported into this ModelFile
getLocalType ClassDeclaration Returns the type with the specified name or null
getModelManager ModelManager Returns the ModelManager associated with this ModelFile
getName string Get the filename for this model file
getNamespace string Get the Namespace for this model file
getParticipantDeclaration ParticipantDeclaration Get the ParticipantDeclaration defined in this ModelFile or null
getParticipantDeclarations ParticipantDeclaration[] Get the ParticipantDeclarations defined in this ModelFile
getTransactionDeclaration TransactionDeclaration Get the TransactionDeclaration defined in this ModelFile or null
getTransactionDeclarations TransactionDeclaration[] Get the TransactionDeclarations defined in this ModelFile
isDefined boolean Returns true if the type is defined in the model file
isSystemModelFile boolean Returns true if this ModelFile is a system model

Method Details

getModelManager

ModelManager getModelManager( )

Returns the ModelManager associated with this ModelFile

Returns

ModelManager - The ModelManager for this ModelFile

See also

Parameters

No parameters

getImports

string[] getImports( )

Returns the types that have been imported into this ModelFile.

Returns

string - The array of imports for this ModelFile

See also

Parameters

No parameters

isDefined

boolean isDefined( string type )

Returns true if the type is defined in the model file

Returns

boolean - true if the type (asset or transaction) is defined

See also

Parameters

Name Type Mandatory Description
type string Yes the name of the type

getLocalType

ClassDeclaration getLocalType( string type )

Returns the type with the specified name or null

Returns

ClassDeclaration - the ClassDeclaration, or null if the type does not exist

See also

Parameters

Name Type Mandatory Description
type string Yes the short OR FQN name of the type

getAssetDeclaration

AssetDeclaration getAssetDeclaration( string name )

Get the AssetDeclarations defined in this ModelFile or null

Returns

AssetDeclaration - the AssetDeclaration with the given short name

See also

Parameters

Name Type Mandatory Description
name string Yes the name of the type

getTransactionDeclaration

TransactionDeclaration getTransactionDeclaration( string name )

Get the TransactionDeclaration defined in this ModelFile or null

Returns

TransactionDeclaration - the TransactionDeclaration with the given short name

See also

Parameters

Name Type Mandatory Description
name string Yes the name of the type

getEventDeclaration

EventDeclaration getEventDeclaration( string name )

Get the EventDeclaration defined in this ModelFile or null

Returns

EventDeclaration - the EventDeclaration with the given short name

See also

Parameters

Name Type Mandatory Description
name string Yes the name of the type

getParticipantDeclaration

ParticipantDeclaration getParticipantDeclaration( string name )

Get the ParticipantDeclaration defined in this ModelFile or null

Returns

ParticipantDeclaration - the ParticipantDeclaration with the given short name

See also

Parameters

Name Type Mandatory Description
name string Yes the name of the type

getNamespace

string getNamespace( )

Get the Namespace for this model file.

Returns

string - The Namespace for this model file

See also

Parameters

No parameters

getName

string getName( )

Get the filename for this model file. Note that this may be null.

Returns

string - The filename for this model file

See also

Parameters

No parameters

getAssetDeclarations

AssetDeclaration[] getAssetDeclarations( Boolean includesystemtype )

Get the AssetDeclarations defined in this ModelFile

Returns

AssetDeclaration - the AssetDeclarations defined in the model file

See also

Parameters

Name Type Mandatory Description
includeSystemType Boolean Yes Include the decalarations of system type in returned data

getTransactionDeclarations

TransactionDeclaration[] getTransactionDeclarations( Boolean includesystemtype )

Get the TransactionDeclarations defined in this ModelFile

Returns

TransactionDeclaration - the TransactionDeclarations defined in the model file

See also

Parameters

Name Type Mandatory Description
includeSystemType Boolean Yes Include the decalarations of system type in returned data

getEventDeclarations

EventDeclaration[] getEventDeclarations( Boolean includesystemtype )

Get the EventDeclarations defined in this ModelFile

Returns

EventDeclaration - the EventDeclarations defined in the model file

See also

Parameters

Name Type Mandatory Description
includeSystemType Boolean Yes Include the decalarations of system type in returned data

getParticipantDeclarations

ParticipantDeclaration[] getParticipantDeclarations( Boolean includesystemtype )

Get the ParticipantDeclarations defined in this ModelFile

Returns

ParticipantDeclaration - the ParticipantDeclaration defined in the model file

See also

Parameters

Name Type Mandatory Description
includeSystemType Boolean Yes Include the decalarations of system type in returned data

getConceptDeclarations

ConceptDeclaration[] getConceptDeclarations( Boolean includesystemtype )

Get the ConceptDeclarations defined in this ModelFile

Returns

ConceptDeclaration - the ParticipantDeclaration defined in the model file

See also

Parameters

Name Type Mandatory Description
includeSystemType Boolean Yes Include the decalarations of system type in returned data

getEnumDeclarations

EnumDeclaration[] getEnumDeclarations( Boolean includesystemtype )

Get the EnumDeclarations defined in this ModelFile

Returns

EnumDeclaration - the EnumDeclaration defined in the model file

See also

Parameters

Name Type Mandatory Description
includeSystemType Boolean Yes Include the decalarations of system type in returned data

getDeclarations

ClassDeclaration[] getDeclarations( Function type, Boolean includesystemtype )

Get the instances of a given type in this ModelFile

Returns

ClassDeclaration - the ClassDeclaration defined in the model file

See also

Parameters

Name Type Mandatory Description
type Function Yes the type of the declaration
includeSystemType Boolean Yes Include the decalarations of system type in returned data

getAllDeclarations

ClassDeclaration[] getAllDeclarations( )

Get all declarations in this ModelFile

Returns

ClassDeclaration - the ClassDeclarations defined in the model file

See also

Parameters

No parameters

getDefinitions

string getDefinitions( )

Get the definitions for this model.

Returns

string - The definitions for this model.

See also

Parameters

No parameters

isSystemModelFile

boolean isSystemModelFile( )

Returns true if this ModelFile is a system model

Returns

boolean - true of this ModelFile is a system model

See also

Parameters

No parameters

Inherited methods