1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package EssentialOCL.impl; |
8 | |
9 | import EMOF.Property; |
10 | |
11 | import EssentialOCL.EssentialOCLPackage; |
12 | import EssentialOCL.PropertyCallExp; |
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>Property Call Exp</b></em>'. |
24 | * <!-- end-user-doc --> |
25 | * <p> |
26 | * The following features are implemented: |
27 | * <ul> |
28 | * <li>{@link EssentialOCL.impl.PropertyCallExpImpl#getReferredProperty <em>Referred Property</em>}</li> |
29 | * </ul> |
30 | * </p> |
31 | * |
32 | * @generated |
33 | */ |
34 | public class PropertyCallExpImpl extends NavigationCallExpImpl implements PropertyCallExp { |
35 | /** |
36 | * The cached value of the '{@link #getReferredProperty() <em>Referred Property</em>}' reference. |
37 | * <!-- begin-user-doc --> |
38 | * <!-- end-user-doc --> |
39 | * @see #getReferredProperty() |
40 | * @generated |
41 | * @ordered |
42 | */ |
43 | protected Property referredProperty; |
44 | |
45 | /** |
46 | * <!-- begin-user-doc --> |
47 | * <!-- end-user-doc --> |
48 | * @generated |
49 | */ |
50 | protected PropertyCallExpImpl() { |
51 | super(); |
52 | } |
53 | |
54 | /** |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @generated |
58 | */ |
59 | @Override |
60 | protected EClass eStaticClass() { |
61 | return EssentialOCLPackage.Literals.PROPERTY_CALL_EXP; |
62 | } |
63 | |
64 | /** |
65 | * <!-- begin-user-doc --> |
66 | * <!-- end-user-doc --> |
67 | * @generated |
68 | */ |
69 | public Property getReferredProperty() { |
70 | if (referredProperty != null && referredProperty.eIsProxy()) { |
71 | InternalEObject oldReferredProperty = (InternalEObject)referredProperty; |
72 | referredProperty = (Property)eResolveProxy(oldReferredProperty); |
73 | if (referredProperty != oldReferredProperty) { |
74 | if (eNotificationRequired()) |
75 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, EssentialOCLPackage.PROPERTY_CALL_EXP__REFERRED_PROPERTY, oldReferredProperty, referredProperty)); |
76 | } |
77 | } |
78 | return referredProperty; |
79 | } |
80 | |
81 | /** |
82 | * <!-- begin-user-doc --> |
83 | * <!-- end-user-doc --> |
84 | * @generated |
85 | */ |
86 | public Property basicGetReferredProperty() { |
87 | return referredProperty; |
88 | } |
89 | |
90 | /** |
91 | * <!-- begin-user-doc --> |
92 | * <!-- end-user-doc --> |
93 | * @generated |
94 | */ |
95 | public void setReferredProperty(Property newReferredProperty) { |
96 | Property oldReferredProperty = referredProperty; |
97 | referredProperty = newReferredProperty; |
98 | if (eNotificationRequired()) |
99 | eNotify(new ENotificationImpl(this, Notification.SET, EssentialOCLPackage.PROPERTY_CALL_EXP__REFERRED_PROPERTY, oldReferredProperty, referredProperty)); |
100 | } |
101 | |
102 | /** |
103 | * <!-- begin-user-doc --> |
104 | * <!-- end-user-doc --> |
105 | * @generated |
106 | */ |
107 | @Override |
108 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
109 | switch (featureID) { |
110 | case EssentialOCLPackage.PROPERTY_CALL_EXP__REFERRED_PROPERTY: |
111 | if (resolve) return getReferredProperty(); |
112 | return basicGetReferredProperty(); |
113 | } |
114 | return super.eGet(featureID, resolve, coreType); |
115 | } |
116 | |
117 | /** |
118 | * <!-- begin-user-doc --> |
119 | * <!-- end-user-doc --> |
120 | * @generated |
121 | */ |
122 | @Override |
123 | public void eSet(int featureID, Object newValue) { |
124 | switch (featureID) { |
125 | case EssentialOCLPackage.PROPERTY_CALL_EXP__REFERRED_PROPERTY: |
126 | setReferredProperty((Property)newValue); |
127 | return; |
128 | } |
129 | super.eSet(featureID, newValue); |
130 | } |
131 | |
132 | /** |
133 | * <!-- begin-user-doc --> |
134 | * <!-- end-user-doc --> |
135 | * @generated |
136 | */ |
137 | @Override |
138 | public void eUnset(int featureID) { |
139 | switch (featureID) { |
140 | case EssentialOCLPackage.PROPERTY_CALL_EXP__REFERRED_PROPERTY: |
141 | setReferredProperty((Property)null); |
142 | return; |
143 | } |
144 | super.eUnset(featureID); |
145 | } |
146 | |
147 | /** |
148 | * <!-- begin-user-doc --> |
149 | * <!-- end-user-doc --> |
150 | * @generated |
151 | */ |
152 | @Override |
153 | public boolean eIsSet(int featureID) { |
154 | switch (featureID) { |
155 | case EssentialOCLPackage.PROPERTY_CALL_EXP__REFERRED_PROPERTY: |
156 | return referredProperty != null; |
157 | } |
158 | return super.eIsSet(featureID); |
159 | } |
160 | |
161 | } //PropertyCallExpImpl |