/
emodelelement_impl.go
134 lines (114 loc) · 4.57 KB
/
emodelelement_impl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// Code generated by soft.generator.go. DO NOT EDIT.
// *****************************************************************************
// Copyright(c) 2021 MASA Group
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//
// *****************************************************************************
package ecore
// eModelElementImpl is the implementation of the model object 'EModelElement'
type eModelElementImpl struct {
CompactEObjectContainer
eAnnotations EList
}
type eModelElementImplInitializers interface {
initEAnnotations() EList
}
// newEModelElementImpl is the constructor of a eModelElementImpl
func newEModelElementImpl() *eModelElementImpl {
eModelElement := new(eModelElementImpl)
eModelElement.SetInterfaces(eModelElement)
eModelElement.Initialize()
return eModelElement
}
func (eModelElement *eModelElementImpl) Initialize() {
eModelElement.CompactEObjectContainer.Initialize()
}
func (eModelElement *eModelElementImpl) asEModelElement() EModelElement {
return eModelElement.GetInterfaces().(EModelElement)
}
func (eModelElement *eModelElementImpl) asInitializers() eModelElementImplInitializers {
return eModelElement.AsEObject().(eModelElementImplInitializers)
}
func (eModelElement *eModelElementImpl) EStaticClass() EClass {
return GetPackage().GetEModelElement()
}
func (eModelElement *eModelElementImpl) EStaticFeatureCount() int {
return EMODEL_ELEMENT_FEATURE_COUNT
}
// GetEAnnotation default implementation
func (eModelElement *eModelElementImpl) GetEAnnotation(string) EAnnotation {
panic("GetEAnnotation not implemented")
}
// GetEAnnotations get the value of eAnnotations
func (eModelElement *eModelElementImpl) GetEAnnotations() EList {
if eModelElement.eAnnotations == nil {
eModelElement.eAnnotations = eModelElement.asInitializers().initEAnnotations()
}
return eModelElement.eAnnotations
}
func (eModelElement *eModelElementImpl) initEAnnotations() EList {
return NewBasicEObjectList(eModelElement.AsEObjectInternal(), EMODEL_ELEMENT__EANNOTATIONS, EANNOTATION__EMODEL_ELEMENT, true, true, true, false, false)
}
func (eModelElement *eModelElementImpl) EGetFromID(featureID int, resolve bool) interface{} {
switch featureID {
case EMODEL_ELEMENT__EANNOTATIONS:
return eModelElement.asEModelElement().GetEAnnotations()
default:
return eModelElement.CompactEObjectContainer.EGetFromID(featureID, resolve)
}
}
func (eModelElement *eModelElementImpl) ESetFromID(featureID int, newValue interface{}) {
switch featureID {
case EMODEL_ELEMENT__EANNOTATIONS:
list := eModelElement.asEModelElement().GetEAnnotations()
list.Clear()
list.AddAll(newValue.(EList))
default:
eModelElement.CompactEObjectContainer.ESetFromID(featureID, newValue)
}
}
func (eModelElement *eModelElementImpl) EUnsetFromID(featureID int) {
switch featureID {
case EMODEL_ELEMENT__EANNOTATIONS:
eModelElement.asEModelElement().GetEAnnotations().Clear()
default:
eModelElement.CompactEObjectContainer.EUnsetFromID(featureID)
}
}
func (eModelElement *eModelElementImpl) EIsSetFromID(featureID int) bool {
switch featureID {
case EMODEL_ELEMENT__EANNOTATIONS:
return eModelElement.eAnnotations != nil && eModelElement.eAnnotations.Size() != 0
default:
return eModelElement.CompactEObjectContainer.EIsSetFromID(featureID)
}
}
func (eModelElement *eModelElementImpl) EInvokeFromID(operationID int, arguments EList) interface{} {
switch operationID {
case EMODEL_ELEMENT__GET_EANNOTATION_ESTRING:
return eModelElement.asEModelElement().GetEAnnotation(arguments.Get(0).(string))
default:
return eModelElement.CompactEObjectContainer.EInvokeFromID(operationID, arguments)
}
}
func (eModelElement *eModelElementImpl) EBasicInverseAdd(otherEnd EObject, featureID int, notifications ENotificationChain) ENotificationChain {
switch featureID {
case EMODEL_ELEMENT__EANNOTATIONS:
list := eModelElement.GetEAnnotations().(ENotifyingList)
return list.AddWithNotification(otherEnd, notifications)
default:
return eModelElement.CompactEObjectContainer.EBasicInverseAdd(otherEnd, featureID, notifications)
}
}
func (eModelElement *eModelElementImpl) EBasicInverseRemove(otherEnd EObject, featureID int, notifications ENotificationChain) ENotificationChain {
switch featureID {
case EMODEL_ELEMENT__EANNOTATIONS:
list := eModelElement.GetEAnnotations().(ENotifyingList)
return list.RemoveWithNotification(otherEnd, notifications)
default:
return eModelElement.CompactEObjectContainer.EBasicInverseRemove(otherEnd, featureID, notifications)
}
}