Overview - Common API - Client API - Admin API - Runtime API
AssetDeclaration
AssetDeclaration defines the schema (aka model or class) for an Asset. It extends ClassDeclaration which manages a set of fields, a super-type and the specification of an identifying field.
Details
Extends ClassDeclaration
Module common
See also
- See ClassDeclaration
Method Summary
Name | Returns | Description |
---|---|---|
constructor | void |
Create an AssetDeclaration |
getSystemType | string |
Returns the base system type for Assets from the system namespace |
isRelationshipTarget | boolean |
Returns true if this class can be pointed to by a relationship |
Inherited Method Summary
Supertype | Name | Returns | Description |
---|---|---|---|
ClassDeclaration | getFullyQualifiedName | string |
Returns the fully qualified name of this class |
ClassDeclaration | getModelFile | ModelFile |
Returns the ModelFile that defines this class |
ClassDeclaration | isAbstract | boolean |
Returns true if this class is declared as abstract in the model file |
ClassDeclaration | isEnum | boolean |
Returns true if this class is an enumeration |
ClassDeclaration | isConcept | boolean |
Returns true if this class is the definition of a concept |
ClassDeclaration | isEvent | boolean |
Returns true if this class is the definition of an event |
ClassDeclaration | isSystemRelationshipTarget | boolean |
Returns true if this class can be pointed to by a relationship in a system model |
ClassDeclaration | isSystemType | boolean |
Returns true is this type is in the system namespace |
ClassDeclaration | isSystemCoreType | boolean |
Returns true if this class is a system core type - both in the system namespace, and also one of the system core types (Asset, Participant, etc) |
ClassDeclaration | getName | string |
Returns the short name of a class |
ClassDeclaration | getNamespace | String |
Return the namespace of this class |
ClassDeclaration | _resolveSuperType | ClassDeclaration |
Resolve the super type on this class and store it as an internal property |
ClassDeclaration | getIdentifierFieldName | string |
Returns the name of the identifying field for this class |
ClassDeclaration | getOwnProperty | Property |
Returns the field with a given name or null if it does not exist |
ClassDeclaration | getOwnProperties | Property[] |
Returns the fields directly defined by this class |
ClassDeclaration | getSuperType | string |
Returns the FQN of the super type for this class or null if this class does not have a super type |
ClassDeclaration | getSuperTypeDeclaration | ClassDeclaration |
Get the super type class declaration for this class |
ClassDeclaration | getAssignableClassDeclarations | ClassDeclaration[] |
Get the class declarations for all subclasses of this class, including this class |
ClassDeclaration | getAllSuperTypeDeclarations | ClassDeclaration[] |
Get all the super-type declarations for this type |
ClassDeclaration | getProperty | Property |
Returns the property with a given name or null if it does not exist |
ClassDeclaration | getProperties | Property[] |
Returns the properties defined in this class and all super classes |
ClassDeclaration | getNestedProperty | Property |
Get a nested property using a dotted property path |
ClassDeclaration | toString | String |
Returns the string representation of this class |
Method Details
new AssetDeclaration()
Create an AssetDeclaration.
See also
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
modelFile | ModelFile | Yes | the ModelFile for this class |
ast | Object | Yes | The AST created by the parser |
isRelationshipTarget
boolean isRelationshipTarget( )
Returns true if this class can be pointed to by a relationship
Returns
boolean - true if the class may be pointed to by a relationship
See also
Parameters
No parameters
getSystemType
string getSystemType( )
Returns the base system type for Assets from the system namespace
Returns
string - the short name of the base system type
See also
Parameters
No parameters
Inherited methods
getModelFile
ModelFile getModelFile( )
Inherited from: ClassDeclaration
Returns the ModelFile that defines this class.
Returns
ModelFile - the owning ModelFile
See also
Parameters
No parameters
_resolveSuperType
ClassDeclaration _resolveSuperType( )
Inherited from: ClassDeclaration
Resolve the super type on this class and store it as an internal property.
Returns
ClassDeclaration - The super type, or null if non specified.
See also
Parameters
No parameters
isAbstract
boolean isAbstract( )
Inherited from: ClassDeclaration
Returns true if this class is declared as abstract in the model file
Returns
boolean - true if the class is abstract
See also
Parameters
No parameters
isEnum
boolean isEnum( )
Inherited from: ClassDeclaration
Returns true if this class is an enumeration.
Returns
boolean - true if the class is an enumerated type
See also
Parameters
No parameters
isConcept
boolean isConcept( )
Inherited from: ClassDeclaration
Returns true if this class is the definition of a concept.
Returns
boolean - true if the class is a concept
See also
Parameters
No parameters
isEvent
boolean isEvent( )
Inherited from: ClassDeclaration
Returns true if this class is the definition of an event.
Returns
boolean - true if the class is an event
See also
Parameters
No parameters
isSystemRelationshipTarget
boolean isSystemRelationshipTarget( )
Inherited from: ClassDeclaration
Returns true if this class can be pointed to by a relationship in a system model
Returns
boolean - true if the class may be pointed to by a relationship
See also
Parameters
No parameters
isSystemType
boolean isSystemType( )
Inherited from: ClassDeclaration
Returns true is this type is in the system namespace
Returns
boolean - true if the class may be pointed to by a relationship
See also
Parameters
No parameters
isSystemCoreType
boolean isSystemCoreType( )
Inherited from: ClassDeclaration
Returns true if this class is a system core type - both in the system namespace, and also one of the system core types (Asset, Participant, etc).
Returns
boolean - true if the class may be pointed to by a relationship
See also
Parameters
No parameters
getName
string getName( )
Inherited from: ClassDeclaration
Returns the short name of a class. This name does not include the namespace from the owning ModelFile.
Returns
string - the short name of this class
See also
Parameters
No parameters
getNamespace
String getNamespace( )
Inherited from: ClassDeclaration
Return the namespace of this class.
Returns
String - namespace - a namespace.
See also
Parameters
No parameters
getFullyQualifiedName
string getFullyQualifiedName( )
Inherited from: ClassDeclaration
Returns the fully qualified name of this class. The name will include the namespace if present.
Returns
string - the fully-qualified name of this class
See also
Parameters
No parameters
getIdentifierFieldName
string getIdentifierFieldName( )
Inherited from: ClassDeclaration
Returns the name of the identifying field for this class. Note that the identifying field may come from a super type.
Returns
string - the name of the id field for this class
See also
Parameters
No parameters
getOwnProperty
Property getOwnProperty( string name )
Inherited from: ClassDeclaration
Returns the field with a given name or null if it does not exist. The field must be directly owned by this class -- the super-type is not introspected.
Returns
Property - the field definition or null if it does not exist.
See also
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
name | string | Yes | the name of the field |
getOwnProperties
Property[] getOwnProperties( )
Inherited from: ClassDeclaration
Returns the fields directly defined by this class.
Returns
Property - the array of fields
See also
Parameters
No parameters
getSuperType
string getSuperType( )
Inherited from: ClassDeclaration
Returns the FQN of the super type for this class or null if this class does not have a super type.
Returns
string - the FQN name of the super type or null
See also
Parameters
No parameters
getSuperTypeDeclaration
ClassDeclaration getSuperTypeDeclaration( )
Inherited from: ClassDeclaration
Get the super type class declaration for this class.
Returns
ClassDeclaration - the super type declaration, or null if there is no super type.
See also
Parameters
No parameters
getAssignableClassDeclarations
ClassDeclaration[] getAssignableClassDeclarations( )
Inherited from: ClassDeclaration
Get the class declarations for all subclasses of this class, including this class.
Returns
ClassDeclaration - subclass declarations.
See also
Parameters
No parameters
getAllSuperTypeDeclarations
ClassDeclaration[] getAllSuperTypeDeclarations( )
Inherited from: ClassDeclaration
Get all the super-type declarations for this type.
Returns
ClassDeclaration - super-type declarations.
See also
Parameters
No parameters
getProperty
Property getProperty( string name )
Inherited from: ClassDeclaration
Returns the property with a given name or null if it does not exist. Fields defined in super-types are also introspected.
Returns
Property - the field, or null if it does not exist
See also
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
name | string | Yes | the name of the field |
getProperties
Property[] getProperties( )
Inherited from: ClassDeclaration
Returns the properties defined in this class and all super classes.
Returns
Property - the array of fields
See also
Parameters
No parameters
getNestedProperty
Property getNestedProperty( string propertypath )
Inherited from: ClassDeclaration
Get a nested property using a dotted property path
Returns
Property - the property
See also
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
propertyPath | string | Yes | The property name or name with nested structure e.g a.b.c |
toString
String toString( )
Inherited from: ClassDeclaration
Returns the string representation of this class
Returns
String - the string representation of the class
See also
Parameters
No parameters