1
2
3
4
5
6
7 package org.mod4j.dsl.datacontract.mm.DataContractDsl.impl;
8
9 import java.util.Collection;
10
11 import org.eclipse.emf.common.notify.NotificationChain;
12
13 import org.eclipse.emf.common.util.EList;
14
15 import org.eclipse.emf.ecore.EClass;
16 import org.eclipse.emf.ecore.InternalEObject;
17
18 import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
19 import org.eclipse.emf.ecore.util.InternalEList;
20
21 import org.mod4j.dsl.datacontract.mm.DataContractDsl.CustomDto;
22 import org.mod4j.dsl.datacontract.mm.DataContractDsl.DataContractDslPackage;
23 import org.mod4j.dsl.datacontract.mm.DataContractDsl.DtoProperty;
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 public class CustomDtoImpl extends DtoImpl implements CustomDto {
39
40
41
42
43
44
45
46
47 protected EList<DtoProperty> properties;
48
49
50
51
52
53
54 protected CustomDtoImpl() {
55 super();
56 }
57
58
59
60
61
62
63 @Override
64 protected EClass eStaticClass() {
65 return DataContractDslPackage.Literals.CUSTOM_DTO;
66 }
67
68
69
70
71
72
73 public EList<DtoProperty> getProperties() {
74 if (properties == null) {
75 properties = new EObjectContainmentWithInverseEList<DtoProperty>(DtoProperty.class, this, DataContractDslPackage.CUSTOM_DTO__PROPERTIES, DataContractDslPackage.DTO_PROPERTY__CUSTOM_DTO);
76 }
77 return properties;
78 }
79
80
81
82
83
84
85 @SuppressWarnings("unchecked")
86 @Override
87 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
88 switch (featureID) {
89 case DataContractDslPackage.CUSTOM_DTO__PROPERTIES:
90 return ((InternalEList<InternalEObject>)(InternalEList<?>)getProperties()).basicAdd(otherEnd, msgs);
91 }
92 return super.eInverseAdd(otherEnd, featureID, msgs);
93 }
94
95
96
97
98
99
100 @Override
101 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
102 switch (featureID) {
103 case DataContractDslPackage.CUSTOM_DTO__PROPERTIES:
104 return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
105 }
106 return super.eInverseRemove(otherEnd, featureID, msgs);
107 }
108
109
110
111
112
113
114 @Override
115 public Object eGet(int featureID, boolean resolve, boolean coreType) {
116 switch (featureID) {
117 case DataContractDslPackage.CUSTOM_DTO__PROPERTIES:
118 return getProperties();
119 }
120 return super.eGet(featureID, resolve, coreType);
121 }
122
123
124
125
126
127
128 @SuppressWarnings("unchecked")
129 @Override
130 public void eSet(int featureID, Object newValue) {
131 switch (featureID) {
132 case DataContractDslPackage.CUSTOM_DTO__PROPERTIES:
133 getProperties().clear();
134 getProperties().addAll((Collection<? extends DtoProperty>)newValue);
135 return;
136 }
137 super.eSet(featureID, newValue);
138 }
139
140
141
142
143
144
145 @Override
146 public void eUnset(int featureID) {
147 switch (featureID) {
148 case DataContractDslPackage.CUSTOM_DTO__PROPERTIES:
149 getProperties().clear();
150 return;
151 }
152 super.eUnset(featureID);
153 }
154
155
156
157
158
159
160 @Override
161 public boolean eIsSet(int featureID) {
162 switch (featureID) {
163 case DataContractDslPackage.CUSTOM_DTO__PROPERTIES:
164 return properties != null && !properties.isEmpty();
165 }
166 return super.eIsSet(featureID);
167 }
168
169 }