Adds UMLStereotypedElementChange post processor.
[EMFCompare2.git] / plugins / org.eclipse.emf.compare.uml2.tests / profile / org / eclipse / emf / compare / uml2 / profile / test / uml2comparetestprofile / impl / AClicheImpl.java
blobd772bcfdbecc4cb33ce9488d784d31bbd08a04a7
1 /*******************************************************************************
2 * Copyright (c) 2011, 2012 Obeo.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Obeo - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl;
13 import java.util.Collection;
15 import org.eclipse.emf.common.notify.Notification;
16 import org.eclipse.emf.common.util.EList;
17 import org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.ACliche;
18 import org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.UML2CompareTestProfilePackage;
19 import org.eclipse.emf.ecore.EClass;
20 import org.eclipse.emf.ecore.InternalEObject;
21 import org.eclipse.emf.ecore.impl.ENotificationImpl;
22 import org.eclipse.emf.ecore.impl.EObjectImpl;
23 import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
24 import org.eclipse.emf.ecore.util.EObjectResolvingEList;
26 /**
27 * <!-- begin-user-doc --> An implementation of the model object '<em><b>ACliche</b></em>'. <!-- end-user-doc
28 * -->
29 * <p>
30 * The following features are implemented:
31 * <ul>
32 * <li>
33 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getSingleValuedAttribute
34 * <em>Single Valued Attribute</em>}</li>
35 * <li>
36 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getManyValuedAttribute
37 * <em>Many Valued Attribute</em>}</li>
38 * <li>
39 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getSingleValuedReference
40 * <em>Single Valued Reference</em>}</li>
41 * <li>
42 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getManyValuedReference
43 * <em>Many Valued Reference</em>}</li>
44 * <li>{@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getBase_Class
45 * <em>Base Class</em>}</li>
46 * </ul>
47 * </p>
49 * @generated
51 public class AClicheImpl extends EObjectImpl implements ACliche {
52 /**
53 * The default value of the '{@link #getSingleValuedAttribute() <em>Single Valued Attribute</em>}'
54 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
56 * @see #getSingleValuedAttribute()
57 * @generated
58 * @ordered
60 protected static final String SINGLE_VALUED_ATTRIBUTE_EDEFAULT = null;
62 /**
63 * The cached value of the '{@link #getSingleValuedAttribute() <em>Single Valued Attribute</em>}'
64 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
66 * @see #getSingleValuedAttribute()
67 * @generated
68 * @ordered
70 protected String singleValuedAttribute = SINGLE_VALUED_ATTRIBUTE_EDEFAULT;
72 /**
73 * The cached value of the '{@link #getManyValuedAttribute() <em>Many Valued Attribute</em>}' attribute
74 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
76 * @see #getManyValuedAttribute()
77 * @generated
78 * @ordered
80 protected EList<String> manyValuedAttribute;
82 /**
83 * The cached value of the '{@link #getSingleValuedReference() <em>Single Valued Reference</em>}'
84 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
86 * @see #getSingleValuedReference()
87 * @generated
88 * @ordered
90 protected org.eclipse.uml2.uml.Class singleValuedReference;
92 /**
93 * The cached value of the '{@link #getManyValuedReference() <em>Many Valued Reference</em>}' reference
94 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
96 * @see #getManyValuedReference()
97 * @generated
98 * @ordered
100 protected EList<org.eclipse.uml2.uml.Class> manyValuedReference;
103 * The cached value of the '{@link #getBase_Class() <em>Base Class</em>}' reference. <!-- begin-user-doc
104 * --> <!-- end-user-doc -->
106 * @see #getBase_Class()
107 * @generated
108 * @ordered
110 protected org.eclipse.uml2.uml.Class base_Class;
113 * <!-- begin-user-doc --> <!-- end-user-doc -->
115 * @generated
117 protected AClicheImpl() {
118 super();
122 * <!-- begin-user-doc --> <!-- end-user-doc -->
124 * @generated
126 @Override
127 protected EClass eStaticClass() {
128 return UML2CompareTestProfilePackage.Literals.ACLICHE;
132 * <!-- begin-user-doc --> <!-- end-user-doc -->
134 * @generated
136 public String getSingleValuedAttribute() {
137 return singleValuedAttribute;
141 * <!-- begin-user-doc --> <!-- end-user-doc -->
143 * @generated
145 public void setSingleValuedAttribute(String newSingleValuedAttribute) {
146 String oldSingleValuedAttribute = singleValuedAttribute;
147 singleValuedAttribute = newSingleValuedAttribute;
148 if (eNotificationRequired()) {
149 eNotify(new ENotificationImpl(this, Notification.SET,
150 UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE, oldSingleValuedAttribute,
151 singleValuedAttribute));
156 * <!-- begin-user-doc --> <!-- end-user-doc -->
158 * @generated
160 public EList<String> getManyValuedAttribute() {
161 if (manyValuedAttribute == null) {
162 manyValuedAttribute = new EDataTypeUniqueEList<String>(String.class, this,
163 UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE);
165 return manyValuedAttribute;
169 * <!-- begin-user-doc --> <!-- end-user-doc -->
171 * @generated
173 public org.eclipse.uml2.uml.Class getSingleValuedReference() {
174 if (singleValuedReference != null && singleValuedReference.eIsProxy()) {
175 InternalEObject oldSingleValuedReference = (InternalEObject)singleValuedReference;
176 singleValuedReference = (org.eclipse.uml2.uml.Class)eResolveProxy(oldSingleValuedReference);
177 if (singleValuedReference != oldSingleValuedReference) {
178 if (eNotificationRequired()) {
179 eNotify(new ENotificationImpl(this, Notification.RESOLVE,
180 UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE,
181 oldSingleValuedReference, singleValuedReference));
185 return singleValuedReference;
189 * <!-- begin-user-doc --> <!-- end-user-doc -->
191 * @generated
193 public org.eclipse.uml2.uml.Class basicGetSingleValuedReference() {
194 return singleValuedReference;
198 * <!-- begin-user-doc --> <!-- end-user-doc -->
200 * @generated
202 public void setSingleValuedReference(org.eclipse.uml2.uml.Class newSingleValuedReference) {
203 org.eclipse.uml2.uml.Class oldSingleValuedReference = singleValuedReference;
204 singleValuedReference = newSingleValuedReference;
205 if (eNotificationRequired()) {
206 eNotify(new ENotificationImpl(this, Notification.SET,
207 UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE, oldSingleValuedReference,
208 singleValuedReference));
213 * <!-- begin-user-doc --> <!-- end-user-doc -->
215 * @generated
217 public EList<org.eclipse.uml2.uml.Class> getManyValuedReference() {
218 if (manyValuedReference == null) {
219 manyValuedReference = new EObjectResolvingEList<org.eclipse.uml2.uml.Class>(
220 org.eclipse.uml2.uml.Class.class, this,
221 UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE);
223 return manyValuedReference;
227 * <!-- begin-user-doc --> <!-- end-user-doc -->
229 * @generated
231 public org.eclipse.uml2.uml.Class getManyValuedReference(String name) {
232 return getManyValuedReference(name, false, null);
236 * <!-- begin-user-doc --> <!-- end-user-doc -->
238 * @generated
240 public org.eclipse.uml2.uml.Class getManyValuedReference(String name, boolean ignoreCase, EClass eClass) {
241 manyValuedReferenceLoop: for (org.eclipse.uml2.uml.Class manyValuedReference : getManyValuedReference()) {
242 if (eClass != null && !eClass.isInstance(manyValuedReference)) {
243 continue manyValuedReferenceLoop;
245 if (name != null
246 && !(ignoreCase ? name.equalsIgnoreCase(manyValuedReference.getName()) : name
247 .equals(manyValuedReference.getName()))) {
248 continue manyValuedReferenceLoop;
250 return manyValuedReference;
252 return null;
256 * <!-- begin-user-doc --> <!-- end-user-doc -->
258 * @generated
260 public org.eclipse.uml2.uml.Class getBase_Class() {
261 if (base_Class != null && base_Class.eIsProxy()) {
262 InternalEObject oldBase_Class = (InternalEObject)base_Class;
263 base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class);
264 if (base_Class != oldBase_Class) {
265 if (eNotificationRequired()) {
266 eNotify(new ENotificationImpl(this, Notification.RESOLVE,
267 UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS, oldBase_Class, base_Class));
271 return base_Class;
275 * <!-- begin-user-doc --> <!-- end-user-doc -->
277 * @generated
279 public org.eclipse.uml2.uml.Class basicGetBase_Class() {
280 return base_Class;
284 * <!-- begin-user-doc --> <!-- end-user-doc -->
286 * @generated
288 public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) {
289 org.eclipse.uml2.uml.Class oldBase_Class = base_Class;
290 base_Class = newBase_Class;
291 if (eNotificationRequired()) {
292 eNotify(new ENotificationImpl(this, Notification.SET,
293 UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS, oldBase_Class, base_Class));
298 * <!-- begin-user-doc --> <!-- end-user-doc -->
300 * @generated
302 @Override
303 public Object eGet(int featureID, boolean resolve, boolean coreType) {
304 switch (featureID) {
305 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE:
306 return getSingleValuedAttribute();
307 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE:
308 return getManyValuedAttribute();
309 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE:
310 if (resolve) {
311 return getSingleValuedReference();
313 return basicGetSingleValuedReference();
314 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE:
315 return getManyValuedReference();
316 case UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS:
317 if (resolve) {
318 return getBase_Class();
320 return basicGetBase_Class();
322 return super.eGet(featureID, resolve, coreType);
326 * <!-- begin-user-doc --> <!-- end-user-doc -->
328 * @generated
330 @SuppressWarnings("unchecked")
331 @Override
332 public void eSet(int featureID, Object newValue) {
333 switch (featureID) {
334 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE:
335 setSingleValuedAttribute((String)newValue);
336 return;
337 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE:
338 getManyValuedAttribute().clear();
339 getManyValuedAttribute().addAll((Collection<? extends String>)newValue);
340 return;
341 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE:
342 setSingleValuedReference((org.eclipse.uml2.uml.Class)newValue);
343 return;
344 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE:
345 getManyValuedReference().clear();
346 getManyValuedReference().addAll((Collection<? extends org.eclipse.uml2.uml.Class>)newValue);
347 return;
348 case UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS:
349 setBase_Class((org.eclipse.uml2.uml.Class)newValue);
350 return;
352 super.eSet(featureID, newValue);
356 * <!-- begin-user-doc --> <!-- end-user-doc -->
358 * @generated
360 @Override
361 public void eUnset(int featureID) {
362 switch (featureID) {
363 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE:
364 setSingleValuedAttribute(SINGLE_VALUED_ATTRIBUTE_EDEFAULT);
365 return;
366 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE:
367 getManyValuedAttribute().clear();
368 return;
369 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE:
370 setSingleValuedReference((org.eclipse.uml2.uml.Class)null);
371 return;
372 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE:
373 getManyValuedReference().clear();
374 return;
375 case UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS:
376 setBase_Class((org.eclipse.uml2.uml.Class)null);
377 return;
379 super.eUnset(featureID);
383 * <!-- begin-user-doc --> <!-- end-user-doc -->
385 * @generated
387 @Override
388 public boolean eIsSet(int featureID) {
389 switch (featureID) {
390 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE:
391 return SINGLE_VALUED_ATTRIBUTE_EDEFAULT == null ? singleValuedAttribute != null
392 : !SINGLE_VALUED_ATTRIBUTE_EDEFAULT.equals(singleValuedAttribute);
393 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE:
394 return manyValuedAttribute != null && !manyValuedAttribute.isEmpty();
395 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE:
396 return singleValuedReference != null;
397 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE:
398 return manyValuedReference != null && !manyValuedReference.isEmpty();
399 case UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS:
400 return base_Class != null;
402 return super.eIsSet(featureID);
406 * <!-- begin-user-doc --> <!-- end-user-doc -->
408 * @generated
410 @Override
411 public String toString() {
412 if (eIsProxy()) {
413 return super.toString();
416 StringBuffer result = new StringBuffer(super.toString());
417 result.append(" (singleValuedAttribute: "); //$NON-NLS-1$
418 result.append(singleValuedAttribute);
419 result.append(", manyValuedAttribute: "); //$NON-NLS-1$
420 result.append(manyValuedAttribute);
421 result.append(')');
422 return result.toString();
425 } // AClicheImpl