blob: de023ee1b5800bf0c336ad29882194ccc9aa1b42 [file] [log] [blame]
/**
* Copyright (c) 2010, 2019 Mia-Software and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
*
* Nicolas Guyomar (Mia-Software) - initial API and implementation
*/
package org.eclipse.modisco.jee.ejbjar.EjbJar31.impl;
import java.lang.String;
import java.util.Collection;
import javax.xml.datatype.XMLGregorianCalendar;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
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.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.modisco.jee.ejbjar.EjbJar31.DescriptionType;
import org.eclipse.modisco.jee.ejbjar.EjbJar31.EjbJar31Package;
import org.eclipse.modisco.jee.ejbjar.EjbJar31.NamedMethodType;
import org.eclipse.modisco.jee.ejbjar.EjbJar31.TimerScheduleType;
import org.eclipse.modisco.jee.ejbjar.EjbJar31.TimerType;
import org.eclipse.modisco.jee.ejbjar.EjbJar31.TrueFalseType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Timer Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.TimerTypeImpl#getDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.TimerTypeImpl#getSchedule <em>Schedule</em>}</li>
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.TimerTypeImpl#getStart <em>Start</em>}</li>
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.TimerTypeImpl#getEnd <em>End</em>}</li>
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.TimerTypeImpl#getTimeoutMethod <em>Timeout Method</em>}</li>
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.TimerTypeImpl#getPersistent <em>Persistent</em>}</li>
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.TimerTypeImpl#getTimezone <em>Timezone</em>}</li>
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.TimerTypeImpl#getInfo <em>Info</em>}</li>
* <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar31.impl.TimerTypeImpl#getId <em>Id</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TimerTypeImpl extends EObjectImpl implements TimerType {
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected EList<DescriptionType> description;
/**
* The cached value of the '{@link #getSchedule() <em>Schedule</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSchedule()
* @generated
* @ordered
*/
protected TimerScheduleType schedule;
/**
* The default value of the '{@link #getStart() <em>Start</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStart()
* @generated
* @ordered
*/
protected static final XMLGregorianCalendar START_EDEFAULT = null;
/**
* The cached value of the '{@link #getStart() <em>Start</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStart()
* @generated
* @ordered
*/
protected XMLGregorianCalendar start = START_EDEFAULT;
/**
* The default value of the '{@link #getEnd() <em>End</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEnd()
* @generated
* @ordered
*/
protected static final XMLGregorianCalendar END_EDEFAULT = null;
/**
* The cached value of the '{@link #getEnd() <em>End</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEnd()
* @generated
* @ordered
*/
protected XMLGregorianCalendar end = END_EDEFAULT;
/**
* The cached value of the '{@link #getTimeoutMethod() <em>Timeout Method</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTimeoutMethod()
* @generated
* @ordered
*/
protected NamedMethodType timeoutMethod;
/**
* The cached value of the '{@link #getPersistent() <em>Persistent</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPersistent()
* @generated
* @ordered
*/
protected TrueFalseType persistent;
/**
* The cached value of the '{@link #getTimezone() <em>Timezone</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTimezone()
* @generated
* @ordered
*/
protected org.eclipse.modisco.jee.ejbjar.EjbJar31.String timezone;
/**
* The cached value of the '{@link #getInfo() <em>Info</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInfo()
* @generated
* @ordered
*/
protected org.eclipse.modisco.jee.ejbjar.EjbJar31.String info;
/**
* 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 TimerTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EjbJar31Package.eINSTANCE.getTimerType();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<DescriptionType> getDescription() {
if (description == null) {
description = new EObjectContainmentEList<DescriptionType>(DescriptionType.class, this, EjbJar31Package.TIMER_TYPE__DESCRIPTION);
}
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TimerScheduleType getSchedule() {
return schedule;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSchedule(TimerScheduleType newSchedule, NotificationChain msgs) {
TimerScheduleType oldSchedule = schedule;
schedule = newSchedule;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__SCHEDULE, oldSchedule, newSchedule);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSchedule(TimerScheduleType newSchedule) {
if (newSchedule != schedule) {
NotificationChain msgs = null;
if (schedule != null)
msgs = ((InternalEObject)schedule).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__SCHEDULE, null, msgs);
if (newSchedule != null)
msgs = ((InternalEObject)newSchedule).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__SCHEDULE, null, msgs);
msgs = basicSetSchedule(newSchedule, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__SCHEDULE, newSchedule, newSchedule));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public XMLGregorianCalendar getStart() {
return start;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStart(XMLGregorianCalendar newStart) {
XMLGregorianCalendar oldStart = start;
start = newStart;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__START, oldStart, start));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public XMLGregorianCalendar getEnd() {
return end;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEnd(XMLGregorianCalendar newEnd) {
XMLGregorianCalendar oldEnd = end;
end = newEnd;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__END, oldEnd, end));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NamedMethodType getTimeoutMethod() {
return timeoutMethod;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetTimeoutMethod(NamedMethodType newTimeoutMethod, NotificationChain msgs) {
NamedMethodType oldTimeoutMethod = timeoutMethod;
timeoutMethod = newTimeoutMethod;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__TIMEOUT_METHOD, oldTimeoutMethod, newTimeoutMethod);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTimeoutMethod(NamedMethodType newTimeoutMethod) {
if (newTimeoutMethod != timeoutMethod) {
NotificationChain msgs = null;
if (timeoutMethod != null)
msgs = ((InternalEObject)timeoutMethod).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__TIMEOUT_METHOD, null, msgs);
if (newTimeoutMethod != null)
msgs = ((InternalEObject)newTimeoutMethod).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__TIMEOUT_METHOD, null, msgs);
msgs = basicSetTimeoutMethod(newTimeoutMethod, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__TIMEOUT_METHOD, newTimeoutMethod, newTimeoutMethod));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TrueFalseType getPersistent() {
return persistent;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPersistent(TrueFalseType newPersistent, NotificationChain msgs) {
TrueFalseType oldPersistent = persistent;
persistent = newPersistent;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__PERSISTENT, oldPersistent, newPersistent);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPersistent(TrueFalseType newPersistent) {
if (newPersistent != persistent) {
NotificationChain msgs = null;
if (persistent != null)
msgs = ((InternalEObject)persistent).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__PERSISTENT, null, msgs);
if (newPersistent != null)
msgs = ((InternalEObject)newPersistent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__PERSISTENT, null, msgs);
msgs = basicSetPersistent(newPersistent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__PERSISTENT, newPersistent, newPersistent));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.modisco.jee.ejbjar.EjbJar31.String getTimezone() {
return timezone;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetTimezone(org.eclipse.modisco.jee.ejbjar.EjbJar31.String newTimezone, NotificationChain msgs) {
org.eclipse.modisco.jee.ejbjar.EjbJar31.String oldTimezone = timezone;
timezone = newTimezone;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__TIMEZONE, oldTimezone, newTimezone);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTimezone(org.eclipse.modisco.jee.ejbjar.EjbJar31.String newTimezone) {
if (newTimezone != timezone) {
NotificationChain msgs = null;
if (timezone != null)
msgs = ((InternalEObject)timezone).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__TIMEZONE, null, msgs);
if (newTimezone != null)
msgs = ((InternalEObject)newTimezone).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__TIMEZONE, null, msgs);
msgs = basicSetTimezone(newTimezone, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__TIMEZONE, newTimezone, newTimezone));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.modisco.jee.ejbjar.EjbJar31.String getInfo() {
return info;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInfo(org.eclipse.modisco.jee.ejbjar.EjbJar31.String newInfo, NotificationChain msgs) {
org.eclipse.modisco.jee.ejbjar.EjbJar31.String oldInfo = info;
info = newInfo;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__INFO, oldInfo, newInfo);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInfo(org.eclipse.modisco.jee.ejbjar.EjbJar31.String newInfo) {
if (newInfo != info) {
NotificationChain msgs = null;
if (info != null)
msgs = ((InternalEObject)info).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__INFO, null, msgs);
if (newInfo != null)
msgs = ((InternalEObject)newInfo).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EjbJar31Package.TIMER_TYPE__INFO, null, msgs);
msgs = basicSetInfo(newInfo, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EjbJar31Package.TIMER_TYPE__INFO, newInfo, newInfo));
}
/**
* <!-- 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.TIMER_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.TIMER_TYPE__DESCRIPTION:
return ((InternalEList<?>)getDescription()).basicRemove(otherEnd, msgs);
case EjbJar31Package.TIMER_TYPE__SCHEDULE:
return basicSetSchedule(null, msgs);
case EjbJar31Package.TIMER_TYPE__TIMEOUT_METHOD:
return basicSetTimeoutMethod(null, msgs);
case EjbJar31Package.TIMER_TYPE__PERSISTENT:
return basicSetPersistent(null, msgs);
case EjbJar31Package.TIMER_TYPE__TIMEZONE:
return basicSetTimezone(null, msgs);
case EjbJar31Package.TIMER_TYPE__INFO:
return basicSetInfo(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.TIMER_TYPE__DESCRIPTION:
return getDescription();
case EjbJar31Package.TIMER_TYPE__SCHEDULE:
return getSchedule();
case EjbJar31Package.TIMER_TYPE__START:
return getStart();
case EjbJar31Package.TIMER_TYPE__END:
return getEnd();
case EjbJar31Package.TIMER_TYPE__TIMEOUT_METHOD:
return getTimeoutMethod();
case EjbJar31Package.TIMER_TYPE__PERSISTENT:
return getPersistent();
case EjbJar31Package.TIMER_TYPE__TIMEZONE:
return getTimezone();
case EjbJar31Package.TIMER_TYPE__INFO:
return getInfo();
case EjbJar31Package.TIMER_TYPE__ID:
return getId();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EjbJar31Package.TIMER_TYPE__DESCRIPTION:
getDescription().clear();
getDescription().addAll((Collection<? extends DescriptionType>)newValue);
return;
case EjbJar31Package.TIMER_TYPE__SCHEDULE:
setSchedule((TimerScheduleType)newValue);
return;
case EjbJar31Package.TIMER_TYPE__START:
setStart((XMLGregorianCalendar)newValue);
return;
case EjbJar31Package.TIMER_TYPE__END:
setEnd((XMLGregorianCalendar)newValue);
return;
case EjbJar31Package.TIMER_TYPE__TIMEOUT_METHOD:
setTimeoutMethod((NamedMethodType)newValue);
return;
case EjbJar31Package.TIMER_TYPE__PERSISTENT:
setPersistent((TrueFalseType)newValue);
return;
case EjbJar31Package.TIMER_TYPE__TIMEZONE:
setTimezone((org.eclipse.modisco.jee.ejbjar.EjbJar31.String)newValue);
return;
case EjbJar31Package.TIMER_TYPE__INFO:
setInfo((org.eclipse.modisco.jee.ejbjar.EjbJar31.String)newValue);
return;
case EjbJar31Package.TIMER_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.TIMER_TYPE__DESCRIPTION:
getDescription().clear();
return;
case EjbJar31Package.TIMER_TYPE__SCHEDULE:
setSchedule((TimerScheduleType)null);
return;
case EjbJar31Package.TIMER_TYPE__START:
setStart(START_EDEFAULT);
return;
case EjbJar31Package.TIMER_TYPE__END:
setEnd(END_EDEFAULT);
return;
case EjbJar31Package.TIMER_TYPE__TIMEOUT_METHOD:
setTimeoutMethod((NamedMethodType)null);
return;
case EjbJar31Package.TIMER_TYPE__PERSISTENT:
setPersistent((TrueFalseType)null);
return;
case EjbJar31Package.TIMER_TYPE__TIMEZONE:
setTimezone((org.eclipse.modisco.jee.ejbjar.EjbJar31.String)null);
return;
case EjbJar31Package.TIMER_TYPE__INFO:
setInfo((org.eclipse.modisco.jee.ejbjar.EjbJar31.String)null);
return;
case EjbJar31Package.TIMER_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.TIMER_TYPE__DESCRIPTION:
return description != null && !description.isEmpty();
case EjbJar31Package.TIMER_TYPE__SCHEDULE:
return schedule != null;
case EjbJar31Package.TIMER_TYPE__START:
return START_EDEFAULT == null ? start != null : !START_EDEFAULT.equals(start);
case EjbJar31Package.TIMER_TYPE__END:
return END_EDEFAULT == null ? end != null : !END_EDEFAULT.equals(end);
case EjbJar31Package.TIMER_TYPE__TIMEOUT_METHOD:
return timeoutMethod != null;
case EjbJar31Package.TIMER_TYPE__PERSISTENT:
return persistent != null;
case EjbJar31Package.TIMER_TYPE__TIMEZONE:
return timezone != null;
case EjbJar31Package.TIMER_TYPE__INFO:
return info != null;
case EjbJar31Package.TIMER_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(" (start: "); //$NON-NLS-1$
result.append(start);
result.append(", end: "); //$NON-NLS-1$
result.append(end);
result.append(", id: "); //$NON-NLS-1$
result.append(id);
result.append(')');
return result.toString();
}
} //TimerTypeImpl