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