KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > JdbcTargetParametersTypeImpl


1 /**
2  * <copyright>
3  * </copyright>
4  *
5  * $Id$
6  */

7 package Olj.impl;
8
9 import Olj.DbVendorType;
10 import Olj.JdbcTargetParameterType;
11 import Olj.JdbcTargetParametersType;
12 import Olj.OljPackage;
13
14 import java.util.Collection JavaDoc;
15
16 import org.eclipse.emf.common.notify.Notification;
17 import org.eclipse.emf.common.notify.NotificationChain;
18
19 import org.eclipse.emf.common.util.EList;
20
21 import org.eclipse.emf.ecore.EClass;
22 import org.eclipse.emf.ecore.EStructuralFeature;
23 import org.eclipse.emf.ecore.InternalEObject;
24
25 import org.eclipse.emf.ecore.impl.ENotificationImpl;
26 import org.eclipse.emf.ecore.impl.EObjectImpl;
27
28 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
29 import org.eclipse.emf.ecore.util.InternalEList;
30
31 /**
32  * <!-- begin-user-doc -->
33  * An implementation of the model object '<em><b>Jdbc Target Parameters Type</b></em>'.
34  * <!-- end-user-doc -->
35  * <p>
36  * The following features are implemented:
37  * <ul>
38  * <li>{@link Olj.impl.JdbcTargetParametersTypeImpl#getJdbcTargetParameter <em>Jdbc Target Parameter</em>}</li>
39  * <li>{@link Olj.impl.JdbcTargetParametersTypeImpl#getDbVendor <em>Db Vendor</em>}</li>
40  * <li>{@link Olj.impl.JdbcTargetParametersTypeImpl#getDriverName <em>Driver Name</em>}</li>
41  * </ul>
42  * </p>
43  *
44  * @generated
45  */

46 public class JdbcTargetParametersTypeImpl extends EObjectImpl implements JdbcTargetParametersType {
47     /**
48      * The cached value of the '{@link #getJdbcTargetParameter() <em>Jdbc Target Parameter</em>}' containment reference list.
49      * <!-- begin-user-doc -->
50      * <!-- end-user-doc -->
51      * @see #getJdbcTargetParameter()
52      * @generated
53      * @ordered
54      */

55     protected EList jdbcTargetParameter = null;
56
57     /**
58      * The default value of the '{@link #getDbVendor() <em>Db Vendor</em>}' attribute.
59      * <!-- begin-user-doc -->
60      * <!-- end-user-doc -->
61      * @see #getDbVendor()
62      * @generated
63      * @ordered
64      */

65     protected static final DbVendorType DB_VENDOR_EDEFAULT = DbVendorType.OCTETSTRING_LITERAL;
66
67     /**
68      * The cached value of the '{@link #getDbVendor() <em>Db Vendor</em>}' attribute.
69      * <!-- begin-user-doc -->
70      * <!-- end-user-doc -->
71      * @see #getDbVendor()
72      * @generated
73      * @ordered
74      */

75     protected DbVendorType dbVendor = DB_VENDOR_EDEFAULT;
76
77     /**
78      * This is true if the Db Vendor attribute has been set.
79      * <!-- begin-user-doc -->
80      * <!-- end-user-doc -->
81      * @generated
82      * @ordered
83      */

84     protected boolean dbVendorESet = false;
85
86     /**
87      * The default value of the '{@link #getDriverName() <em>Driver Name</em>}' attribute.
88      * <!-- begin-user-doc -->
89      * <!-- end-user-doc -->
90      * @see #getDriverName()
91      * @generated
92      * @ordered
93      */

94     protected static final String JavaDoc DRIVER_NAME_EDEFAULT = null;
95
96     /**
97      * The cached value of the '{@link #getDriverName() <em>Driver Name</em>}' attribute.
98      * <!-- begin-user-doc -->
99      * <!-- end-user-doc -->
100      * @see #getDriverName()
101      * @generated
102      * @ordered
103      */

104     protected String JavaDoc driverName = DRIVER_NAME_EDEFAULT;
105
106     /**
107      * <!-- begin-user-doc -->
108      * <!-- end-user-doc -->
109      * @generated
110      */

111     protected JdbcTargetParametersTypeImpl() {
112         super();
113     }
114
115     /**
116      * <!-- begin-user-doc -->
117      * <!-- end-user-doc -->
118      * @generated
119      */

120     protected EClass eStaticClass() {
121         return OljPackage.eINSTANCE.getJdbcTargetParametersType();
122     }
123
124     /**
125      * <!-- begin-user-doc -->
126      * <!-- end-user-doc -->
127      * @generated
128      */

129     public EList getJdbcTargetParameter() {
130         if (jdbcTargetParameter == null) {
131             jdbcTargetParameter = new EObjectContainmentEList(JdbcTargetParameterType.class, this, OljPackage.JDBC_TARGET_PARAMETERS_TYPE__JDBC_TARGET_PARAMETER);
132         }
133         return jdbcTargetParameter;
134     }
135
136     /**
137      * <!-- begin-user-doc -->
138      * <!-- end-user-doc -->
139      * @generated
140      */

141     public DbVendorType getDbVendor() {
142         return dbVendor;
143     }
144
145     /**
146      * <!-- begin-user-doc -->
147      * <!-- end-user-doc -->
148      * @generated
149      */

150     public void setDbVendor(DbVendorType newDbVendor) {
151         DbVendorType oldDbVendor = dbVendor;
152         dbVendor = newDbVendor == null ? DB_VENDOR_EDEFAULT : newDbVendor;
153         boolean oldDbVendorESet = dbVendorESet;
154         dbVendorESet = true;
155         if (eNotificationRequired())
156             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DB_VENDOR, oldDbVendor, dbVendor, !oldDbVendorESet));
157     }
158
159     /**
160      * <!-- begin-user-doc -->
161      * <!-- end-user-doc -->
162      * @generated
163      */

164     public void unsetDbVendor() {
165         DbVendorType oldDbVendor = dbVendor;
166         boolean oldDbVendorESet = dbVendorESet;
167         dbVendor = DB_VENDOR_EDEFAULT;
168         dbVendorESet = false;
169         if (eNotificationRequired())
170             eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DB_VENDOR, oldDbVendor, DB_VENDOR_EDEFAULT, oldDbVendorESet));
171     }
172
173     /**
174      * <!-- begin-user-doc -->
175      * <!-- end-user-doc -->
176      * @generated
177      */

178     public boolean isSetDbVendor() {
179         return dbVendorESet;
180     }
181
182     /**
183      * <!-- begin-user-doc -->
184      * <!-- end-user-doc -->
185      * @generated
186      */

187     public String JavaDoc getDriverName() {
188         return driverName;
189     }
190
191     /**
192      * <!-- begin-user-doc -->
193      * <!-- end-user-doc -->
194      * @generated
195      */

196     public void setDriverName(String JavaDoc newDriverName) {
197         String JavaDoc oldDriverName = driverName;
198         driverName = newDriverName;
199         if (eNotificationRequired())
200             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DRIVER_NAME, oldDriverName, driverName));
201     }
202
203     /**
204      * <!-- begin-user-doc -->
205      * <!-- end-user-doc -->
206      * @generated
207      */

208     public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs) {
209         if (featureID >= 0) {
210             switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
211                 case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__JDBC_TARGET_PARAMETER:
212                     return ((InternalEList)getJdbcTargetParameter()).basicRemove(otherEnd, msgs);
213                 default:
214                     return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
215             }
216         }
217         return eBasicSetContainer(null, featureID, msgs);
218     }
219
220     /**
221      * <!-- begin-user-doc -->
222      * <!-- end-user-doc -->
223      * @generated
224      */

225     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
226         switch (eDerivedStructuralFeatureID(eFeature)) {
227             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__JDBC_TARGET_PARAMETER:
228                 return getJdbcTargetParameter();
229             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DB_VENDOR:
230                 return getDbVendor();
231             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DRIVER_NAME:
232                 return getDriverName();
233         }
234         return eDynamicGet(eFeature, resolve);
235     }
236
237     /**
238      * <!-- begin-user-doc -->
239      * <!-- end-user-doc -->
240      * @generated
241      */

242     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
243         switch (eDerivedStructuralFeatureID(eFeature)) {
244             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__JDBC_TARGET_PARAMETER:
245                 getJdbcTargetParameter().clear();
246                 getJdbcTargetParameter().addAll((Collection JavaDoc)newValue);
247                 return;
248             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DB_VENDOR:
249                 setDbVendor((DbVendorType)newValue);
250                 return;
251             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DRIVER_NAME:
252                 setDriverName((String JavaDoc)newValue);
253                 return;
254         }
255         eDynamicSet(eFeature, newValue);
256     }
257
258     /**
259      * <!-- begin-user-doc -->
260      * <!-- end-user-doc -->
261      * @generated
262      */

263     public void eUnset(EStructuralFeature eFeature) {
264         switch (eDerivedStructuralFeatureID(eFeature)) {
265             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__JDBC_TARGET_PARAMETER:
266                 getJdbcTargetParameter().clear();
267                 return;
268             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DB_VENDOR:
269                 unsetDbVendor();
270                 return;
271             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DRIVER_NAME:
272                 setDriverName(DRIVER_NAME_EDEFAULT);
273                 return;
274         }
275         eDynamicUnset(eFeature);
276     }
277
278     /**
279      * <!-- begin-user-doc -->
280      * <!-- end-user-doc -->
281      * @generated
282      */

283     public boolean eIsSet(EStructuralFeature eFeature) {
284         switch (eDerivedStructuralFeatureID(eFeature)) {
285             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__JDBC_TARGET_PARAMETER:
286                 return jdbcTargetParameter != null && !jdbcTargetParameter.isEmpty();
287             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DB_VENDOR:
288                 return isSetDbVendor();
289             case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__DRIVER_NAME:
290                 return DRIVER_NAME_EDEFAULT == null ? driverName != null : !DRIVER_NAME_EDEFAULT.equals(driverName);
291         }
292         return eDynamicIsSet(eFeature);
293     }
294
295     /**
296      * <!-- begin-user-doc -->
297      * <!-- end-user-doc -->
298      * @generated
299      */

300     public String JavaDoc toString() {
301         if (eIsProxy()) return super.toString();
302
303         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
304         result.append(" (dbVendor: ");
305         if (dbVendorESet) result.append(dbVendor); else result.append("<unset>");
306         result.append(", driverName: ");
307         result.append(driverName);
308         result.append(')');
309         return result.toString();
310     }
311
312 } //JdbcTargetParametersTypeImpl
313
Popular Tags