Class: abstract
StructuralModel
Base class for structural models.
Extends
Extended by
Constructors
new StructuralModel()
protected
new StructuralModel(state
:Readonly
<StructuralModelState
>):StructuralModel
Parameters
Parameter | Type |
---|---|
state | Readonly <StructuralModelState > |
Returns
Overrides
Defined in
packages/verse-core/src/model/model.ts:372
Accessors
allProperties
get
allProperties():List
<PropertyModel
>
Returns
List
<PropertyModel
>
Defined in
packages/verse-core/src/model/model.ts:401
klass
get
klass():Newable
<unknown
>
Returns
Newable
<unknown
>
Defined in
packages/verse-core/src/model/model.ts:393
name
get
name():string
Returns
string
Defined in
packages/verse-core/src/model/model.ts:380
parent
get
parent():Model
Returns the parent model element.
Returns
The parent model element.
Overrides
Defined in
packages/verse-core/src/model/model.ts:477
properties
get
properties():List
<PropertyModel
>
Returns
List
<PropertyModel
>
Defined in
packages/verse-core/src/model/model.ts:397
scalars
get
scalars():List
<ScalarPropertyModel
>
Returns
List
<ScalarPropertyModel
>
Defined in
packages/verse-core/src/model/model.ts:425
scalarsAndValues
get
scalarsAndValues():List
<ScalarPropertyModel
|ValueObjectPropertyModel
>
Returns
List
<ScalarPropertyModel
| ValueObjectPropertyModel
>
Defined in
packages/verse-core/src/model/model.ts:437
state
get
protected
state():Readonly
<StructuralModelState
>
Returns
Readonly
<StructuralModelState
>
Defined in
packages/verse-core/src/model/model.ts:473
values
get
values():List
<ValueObjectPropertyModel
>
Returns
List
<ValueObjectPropertyModel
>
Defined in
packages/verse-core/src/model/model.ts:431
Methods
accept()
abstract
accept<T
,S
>(visitor
:ModelVisitor
<T
,S
>,state
?:S
):T
Accepts a visitor and returns the result of visiting this model element.
Type Parameters
Type Parameter | Default type |
---|---|
T | - |
S | unknown |
Parameters
Parameter | Type | Description |
---|---|---|
visitor | ModelVisitor <T , S > | The visitor to accept. |
state ? | S | An optional state to pass to the visitor. |
Returns
T
The result of visiting this model element.
Inherited from
Defined in
packages/verse-core/src/model/model.ts:41
equals()
equals(
other
:unknown
):boolean
Checks if the current object is equal to the provided object.
Parameters
Parameter | Type | Description |
---|---|---|
other | unknown | The object to compare with. |
Returns
boolean
Whether the objects are equal or not.
Overrides
Defined in
packages/verse-core/src/model/model.ts:488
hashCode()
hashCode():
number
Returns the hash code of this object.
Returns
number
The hash code.
Overrides
Defined in
packages/verse-core/src/model/model.ts:497
rewrite()
rewrite(
rewriter
:ModelRewriter
):AbstractModel
Rewrite method for processing a given model with a rewriter.
Parameters
Parameter | Type | Description |
---|---|---|
rewriter | ModelRewriter | The rewriter to use for rewriting the model. |
Returns
The rewritten model.
Inherited from
Defined in
packages/verse-core/src/model/model.ts:55
scalar()
scalar(
name
:string
):ScalarPropertyModel
Parameters
Parameter | Type |
---|---|
name | string |
Returns
Defined in
packages/verse-core/src/model/model.ts:441
scalarFlatMap()
scalarFlatMap<
T
>(action
: (path
:ScalarPropertyPath
) =>T
):List
<T
>
Type Parameters
Type Parameter | Default type |
---|---|
T | ScalarPropertyPath |
Parameters
Parameter | Type |
---|---|
action | (path : ScalarPropertyPath ) => T |
Returns
List
<T
>
Defined in
packages/verse-core/src/model/model.ts:451
toJSON()
toJSON():
string
Returns a JSON representation of this model element.
Returns
string
The JSON representation.
Inherited from
Defined in
packages/verse-core/src/model/model.ts:82
toObject()
toObject(): {
name
:string
;properties
:object
[]; }
Returns this instance as a plain object.
Returns
{name
: string
;properties
: object
[]; }
The plain object.
name
name:
string
properties
properties:
object
[]
Overrides
Defined in
packages/verse-core/src/model/model.ts:481
withName()
withName(
name
:string
):any
Parameters
Parameter | Type |
---|---|
name | string |
Returns
any
Defined in
packages/verse-core/src/model/model.ts:384
withProperties()
abstract
protected
withProperties(properties
:List
<PropertyModel
>):StructuralModel
Parameters
Parameter | Type |
---|---|
properties | List <PropertyModel > |
Returns
Defined in
packages/verse-core/src/model/model.ts:423
withProperty()
withProperty(
property
:PropertyModel
):StructuralModel
Parameters
Parameter | Type |
---|---|
property | PropertyModel |