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