/** | |
* Copyright (c) 2010 Mia-Software. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: | |
* | |
* Nicolas Guyomar (Mia-Software) - initial API and implementation | |
*/ | |
package org.eclipse.modisco.jee.ejbjar.EjbJar31.impl; | |
import java.lang.String; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.common.notify.NotificationChain; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.emf.ecore.impl.EObjectImpl; | |
import org.eclipse.modisco.jee.ejbjar.EjbJar31.EjbJar31Package; | |
import org.eclipse.modisco.jee.ejbjar.EjbJar31.StatefulTimeoutType; | |
import org.eclipse.modisco.jee.ejbjar.EjbJar31.TimeUnitTypeType; | |
import org.eclipse.modisco.jee.ejbjar.EjbJar31.XsdIntegerType; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Stateful Timeout Type</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.StatefulTimeoutTypeImpl#getTimeout <em>Timeout</em>}</li> | |
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.StatefulTimeoutTypeImpl#getUnit <em>Unit</em>}</li> | |
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.StatefulTimeoutTypeImpl#getId <em>Id</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class StatefulTimeoutTypeImpl extends EObjectImpl implements StatefulTimeoutType { | |
/** | |
* The cached value of the '{@link #getTimeout() <em>Timeout</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getTimeout() | |
* @generated | |
* @ordered | |
*/ | |
protected XsdIntegerType timeout; | |
/** | |
* The cached value of the '{@link #getUnit() <em>Unit</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getUnit() | |
* @generated | |
* @ordered | |
*/ | |
protected TimeUnitTypeType unit; | |
/** | |
* The default value of the '{@link #getId() <em>Id</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getId() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String ID_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getId() <em>Id</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getId() | |
* @generated | |
* @ordered | |
*/ | |
protected String id = ID_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected StatefulTimeoutTypeImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return EjbJar31Package.eINSTANCE.getStatefulTimeoutType(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public XsdIntegerType getTimeout() { | |
return timeout; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetTimeout(XsdIntegerType newTimeout, NotificationChain msgs) { | |
XsdIntegerType oldTimeout = timeout; | |
timeout = newTimeout; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EjbJar31Package.STATEFUL_TIMEOUT_TYPE__TIMEOUT, oldTimeout, newTimeout); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setTimeout(XsdIntegerType newTimeout) { | |
if (newTimeout != timeout) { | |
NotificationChain msgs = null; | |
if (timeout != null) | |
msgs = ((InternalEObject)timeout).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.STATEFUL_TIMEOUT_TYPE__TIMEOUT, null, msgs); | |
if (newTimeout != null) | |
msgs = ((InternalEObject)newTimeout).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.STATEFUL_TIMEOUT_TYPE__TIMEOUT, null, msgs); | |
msgs = basicSetTimeout(newTimeout, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.STATEFUL_TIMEOUT_TYPE__TIMEOUT, newTimeout, newTimeout)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public TimeUnitTypeType getUnit() { | |
return unit; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetUnit(TimeUnitTypeType newUnit, NotificationChain msgs) { | |
TimeUnitTypeType oldUnit = unit; | |
unit = newUnit; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EjbJar31Package.STATEFUL_TIMEOUT_TYPE__UNIT, oldUnit, newUnit); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setUnit(TimeUnitTypeType newUnit) { | |
if (newUnit != unit) { | |
NotificationChain msgs = null; | |
if (unit != null) | |
msgs = ((InternalEObject)unit).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.STATEFUL_TIMEOUT_TYPE__UNIT, null, msgs); | |
if (newUnit != null) | |
msgs = ((InternalEObject)newUnit).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.STATEFUL_TIMEOUT_TYPE__UNIT, null, msgs); | |
msgs = basicSetUnit(newUnit, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.STATEFUL_TIMEOUT_TYPE__UNIT, newUnit, newUnit)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getId() { | |
return id; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setId(String newId) { | |
String oldId = id; | |
id = newId; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.STATEFUL_TIMEOUT_TYPE__ID, oldId, id)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__TIMEOUT: | |
return basicSetTimeout(null, msgs); | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__UNIT: | |
return basicSetUnit(null, msgs); | |
} | |
return super.eInverseRemove(otherEnd, featureID, msgs); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__TIMEOUT: | |
return getTimeout(); | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__UNIT: | |
return getUnit(); | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__ID: | |
return getId(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__TIMEOUT: | |
setTimeout((XsdIntegerType)newValue); | |
return; | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__UNIT: | |
setUnit((TimeUnitTypeType)newValue); | |
return; | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__ID: | |
setId((String)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__TIMEOUT: | |
setTimeout((XsdIntegerType)null); | |
return; | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__UNIT: | |
setUnit((TimeUnitTypeType)null); | |
return; | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__ID: | |
setId(ID_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__TIMEOUT: | |
return timeout != null; | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__UNIT: | |
return unit != null; | |
case EjbJar31Package.STATEFUL_TIMEOUT_TYPE__ID: | |
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); | |
} | |
return super.eIsSet(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public String toString() { | |
if (eIsProxy()) return super.toString(); | |
StringBuffer result = new StringBuffer(super.toString()); | |
result.append(" (id: "); //$NON-NLS-1$ | |
result.append(id); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //StatefulTimeoutTypeImpl |