1
2
3
4
5
6 package org.mod4j.crossx.mm.crossx.impl;
7
8 import org.eclipse.emf.common.notify.Notification;
9
10 import org.eclipse.emf.ecore.EClass;
11
12 import org.eclipse.emf.ecore.impl.ENotificationImpl;
13
14 import org.mod4j.crossx.mm.crossx.CrossxPackage;
15 import org.mod4j.crossx.mm.crossx.LiteralSymbolProperty;
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 public class LiteralSymbolPropertyImpl extends SymbolPropertyImpl implements LiteralSymbolProperty {
31
32
33
34
35
36
37
38
39 protected static final String VALUE_EDEFAULT = null;
40
41
42
43
44
45
46
47
48
49 protected String value = VALUE_EDEFAULT;
50
51
52
53
54
55
56 protected LiteralSymbolPropertyImpl() {
57 super();
58 }
59
60
61
62
63
64
65 @Override
66 protected EClass eStaticClass() {
67 return CrossxPackage.Literals.LITERAL_SYMBOL_PROPERTY;
68 }
69
70
71
72
73
74
75 public String getValue() {
76 return value;
77 }
78
79
80
81
82
83
84 public void setValue(String newValue) {
85 String oldValue = value;
86 value = newValue;
87 if (eNotificationRequired())
88 eNotify(new ENotificationImpl(this, Notification.SET, CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE, oldValue, value));
89 }
90
91
92
93
94
95
96 @Override
97 public Object eGet(int featureID, boolean resolve, boolean coreType) {
98 switch (featureID) {
99 case CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE:
100 return getValue();
101 }
102 return super.eGet(featureID, resolve, coreType);
103 }
104
105
106
107
108
109
110 @Override
111 public void eSet(int featureID, Object newValue) {
112 switch (featureID) {
113 case CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE:
114 setValue((String)newValue);
115 return;
116 }
117 super.eSet(featureID, newValue);
118 }
119
120
121
122
123
124
125 @Override
126 public void eUnset(int featureID) {
127 switch (featureID) {
128 case CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE:
129 setValue(VALUE_EDEFAULT);
130 return;
131 }
132 super.eUnset(featureID);
133 }
134
135
136
137
138
139
140 @Override
141 public boolean eIsSet(int featureID) {
142 switch (featureID) {
143 case CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE:
144 return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
145 }
146 return super.eIsSet(featureID);
147 }
148
149
150
151
152
153
154 @Override
155 public String toString() {
156 if (eIsProxy()) return super.toString();
157
158 StringBuffer result = new StringBuffer(super.toString());
159 result.append(" (value: ");
160 result.append(value);
161 result.append(')');
162 return result.toString();
163 }
164
165 }