1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package EMOF.impl; |
8 | |
9 | import EMOF.DataType; |
10 | import EMOF.EMOFPackage; |
11 | import EMOF.Element; |
12 | import EMOF.Factory; |
13 | |
14 | import org.eclipse.emf.common.notify.Notification; |
15 | |
16 | import org.eclipse.emf.ecore.EClass; |
17 | import org.eclipse.emf.ecore.InternalEObject; |
18 | |
19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
20 | |
21 | /** |
22 | * <!-- begin-user-doc --> |
23 | * An implementation of the model object '<em><b>Factory</b></em>'. |
24 | * <!-- end-user-doc --> |
25 | * <p> |
26 | * The following features are implemented: |
27 | * <ul> |
28 | * <li>{@link EMOF.impl.FactoryImpl#getPackage <em>Package</em>}</li> |
29 | * </ul> |
30 | * </p> |
31 | * |
32 | * @generated |
33 | */ |
34 | public class FactoryImpl extends ElementImpl implements Factory { |
35 | /** |
36 | * The cached value of the '{@link #getPackage() <em>Package</em>}' reference. |
37 | * <!-- begin-user-doc --> |
38 | * <!-- end-user-doc --> |
39 | * @see #getPackage() |
40 | * @generated |
41 | * @ordered |
42 | */ |
43 | protected EMOF.Package package_; |
44 | |
45 | /** |
46 | * <!-- begin-user-doc --> |
47 | * <!-- end-user-doc --> |
48 | * @generated |
49 | */ |
50 | protected FactoryImpl() { |
51 | super(); |
52 | } |
53 | |
54 | /** |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @generated |
58 | */ |
59 | @Override |
60 | protected EClass eStaticClass() { |
61 | return EMOFPackage.Literals.FACTORY; |
62 | } |
63 | |
64 | /** |
65 | * <!-- begin-user-doc --> |
66 | * <!-- end-user-doc --> |
67 | * @generated |
68 | */ |
69 | public EMOF.Package getPackage() { |
70 | if (package_ != null && package_.eIsProxy()) { |
71 | InternalEObject oldPackage = (InternalEObject)package_; |
72 | package_ = (EMOF.Package)eResolveProxy(oldPackage); |
73 | if (package_ != oldPackage) { |
74 | if (eNotificationRequired()) |
75 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, EMOFPackage.FACTORY__PACKAGE, oldPackage, package_)); |
76 | } |
77 | } |
78 | return package_; |
79 | } |
80 | |
81 | /** |
82 | * <!-- begin-user-doc --> |
83 | * <!-- end-user-doc --> |
84 | * @generated |
85 | */ |
86 | public EMOF.Package basicGetPackage() { |
87 | return package_; |
88 | } |
89 | |
90 | /** |
91 | * <!-- begin-user-doc --> |
92 | * <!-- end-user-doc --> |
93 | * @generated |
94 | */ |
95 | public void setPackage(EMOF.Package newPackage) { |
96 | EMOF.Package oldPackage = package_; |
97 | package_ = newPackage; |
98 | if (eNotificationRequired()) |
99 | eNotify(new ENotificationImpl(this, Notification.SET, EMOFPackage.FACTORY__PACKAGE, oldPackage, package_)); |
100 | } |
101 | |
102 | /** |
103 | * <!-- begin-user-doc --> |
104 | * <!-- end-user-doc --> |
105 | * @generated |
106 | */ |
107 | public String convertToString(DataType dataType, EMOF.Object object) { |
108 | // TODO: implement this method |
109 | // Ensure that you remove @generated or mark it @generated NOT |
110 | throw new UnsupportedOperationException(); |
111 | } |
112 | |
113 | /** |
114 | * <!-- begin-user-doc --> |
115 | * <!-- end-user-doc --> |
116 | * @generated |
117 | */ |
118 | public Element create(EMOF.Class metaClass) { |
119 | // TODO: implement this method |
120 | // Ensure that you remove @generated or mark it @generated NOT |
121 | throw new UnsupportedOperationException(); |
122 | } |
123 | |
124 | /** |
125 | * <!-- begin-user-doc --> |
126 | * <!-- end-user-doc --> |
127 | * @generated |
128 | */ |
129 | public EMOF.Object createFromString(DataType dataType, String string) { |
130 | // TODO: implement this method |
131 | // Ensure that you remove @generated or mark it @generated NOT |
132 | throw new UnsupportedOperationException(); |
133 | } |
134 | |
135 | /** |
136 | * <!-- begin-user-doc --> |
137 | * <!-- end-user-doc --> |
138 | * @generated |
139 | */ |
140 | @Override |
141 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
142 | switch (featureID) { |
143 | case EMOFPackage.FACTORY__PACKAGE: |
144 | if (resolve) return getPackage(); |
145 | return basicGetPackage(); |
146 | } |
147 | return super.eGet(featureID, resolve, coreType); |
148 | } |
149 | |
150 | /** |
151 | * <!-- begin-user-doc --> |
152 | * <!-- end-user-doc --> |
153 | * @generated |
154 | */ |
155 | @Override |
156 | public void eSet(int featureID, Object newValue) { |
157 | switch (featureID) { |
158 | case EMOFPackage.FACTORY__PACKAGE: |
159 | setPackage((EMOF.Package)newValue); |
160 | return; |
161 | } |
162 | super.eSet(featureID, newValue); |
163 | } |
164 | |
165 | /** |
166 | * <!-- begin-user-doc --> |
167 | * <!-- end-user-doc --> |
168 | * @generated |
169 | */ |
170 | @Override |
171 | public void eUnset(int featureID) { |
172 | switch (featureID) { |
173 | case EMOFPackage.FACTORY__PACKAGE: |
174 | setPackage((EMOF.Package)null); |
175 | return; |
176 | } |
177 | super.eUnset(featureID); |
178 | } |
179 | |
180 | /** |
181 | * <!-- begin-user-doc --> |
182 | * <!-- end-user-doc --> |
183 | * @generated |
184 | */ |
185 | @Override |
186 | public boolean eIsSet(int featureID) { |
187 | switch (featureID) { |
188 | case EMOFPackage.FACTORY__PACKAGE: |
189 | return package_ != null; |
190 | } |
191 | return super.eIsSet(featureID); |
192 | } |
193 | |
194 | } //FactoryImpl |