1 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 ; 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 46 public class JdbcTargetParametersTypeImpl extends EObjectImpl implements JdbcTargetParametersType { 47 55 protected EList jdbcTargetParameter = null; 56 57 65 protected static final DbVendorType DB_VENDOR_EDEFAULT = DbVendorType.OCTETSTRING_LITERAL; 66 67 75 protected DbVendorType dbVendor = DB_VENDOR_EDEFAULT; 76 77 84 protected boolean dbVendorESet = false; 85 86 94 protected static final String DRIVER_NAME_EDEFAULT = null; 95 96 104 protected String driverName = DRIVER_NAME_EDEFAULT; 105 106 111 protected JdbcTargetParametersTypeImpl() { 112 super(); 113 } 114 115 120 protected EClass eStaticClass() { 121 return OljPackage.eINSTANCE.getJdbcTargetParametersType(); 122 } 123 124 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 141 public DbVendorType getDbVendor() { 142 return dbVendor; 143 } 144 145 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 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 178 public boolean isSetDbVendor() { 179 return dbVendorESet; 180 } 181 182 187 public String getDriverName() { 188 return driverName; 189 } 190 191 196 public void setDriverName(String newDriverName) { 197 String 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 208 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class 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 225 public Object 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 242 public void eSet(EStructuralFeature eFeature, Object newValue) { 243 switch (eDerivedStructuralFeatureID(eFeature)) { 244 case OljPackage.JDBC_TARGET_PARAMETERS_TYPE__JDBC_TARGET_PARAMETER: 245 getJdbcTargetParameter().clear(); 246 getJdbcTargetParameter().addAll((Collection )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 )newValue); 253 return; 254 } 255 eDynamicSet(eFeature, newValue); 256 } 257 258 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 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 300 public String toString() { 301 if (eIsProxy()) return super.toString(); 302 303 StringBuffer result = new StringBuffer (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 } | Popular Tags |