blob: e74d64cd764611efdfe7b789e5296203aa805e6a [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
* $Id: ProcessComponentImpl.java,v 1.2 2008/01/30 00:41:47 klow Exp $
*/
package org.eclipse.epf.xml.uma.impl;
import javax.xml.datatype.XMLGregorianCalendar;
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.epf.xml.uma.ProcessComponent;
import org.eclipse.epf.xml.uma.ProcessComponentInterface;
import org.eclipse.epf.xml.uma.UmaPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Process Component</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.epf.xml.uma.impl.ProcessComponentImpl#getCopyright <em>Copyright</em>}</li>
* <li>{@link org.eclipse.epf.xml.uma.impl.ProcessComponentImpl#getInterface <em>Interface</em>}</li>
* <li>{@link org.eclipse.epf.xml.uma.impl.ProcessComponentImpl#getProcess <em>Process</em>}</li>
* <li>{@link org.eclipse.epf.xml.uma.impl.ProcessComponentImpl#getAuthors <em>Authors</em>}</li>
* <li>{@link org.eclipse.epf.xml.uma.impl.ProcessComponentImpl#getChangeDate <em>Change Date</em>}</li>
* <li>{@link org.eclipse.epf.xml.uma.impl.ProcessComponentImpl#getChangeDescription <em>Change Description</em>}</li>
* <li>{@link org.eclipse.epf.xml.uma.impl.ProcessComponentImpl#getVersion <em>Version</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ProcessComponentImpl extends ProcessPackageImpl implements ProcessComponent {
/**
* The default value of the '{@link #getCopyright() <em>Copyright</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCopyright()
* @generated
* @ordered
*/
protected static final String COPYRIGHT_EDEFAULT = null;
/**
* The cached value of the '{@link #getCopyright() <em>Copyright</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCopyright()
* @generated
* @ordered
*/
protected String copyright = COPYRIGHT_EDEFAULT;
/**
* The cached value of the '{@link #getInterface() <em>Interface</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInterface()
* @generated
* @ordered
*/
protected ProcessComponentInterface interface_;
/**
* The cached value of the '{@link #getProcess() <em>Process</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProcess()
* @generated
* @ordered
*/
protected org.eclipse.epf.xml.uma.Process process;
/**
* The default value of the '{@link #getAuthors() <em>Authors</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthors()
* @generated
* @ordered
*/
protected static final String AUTHORS_EDEFAULT = null;
/**
* The cached value of the '{@link #getAuthors() <em>Authors</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthors()
* @generated
* @ordered
*/
protected String authors = AUTHORS_EDEFAULT;
/**
* The default value of the '{@link #getChangeDate() <em>Change Date</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getChangeDate()
* @generated
* @ordered
*/
protected static final XMLGregorianCalendar CHANGE_DATE_EDEFAULT = null;
/**
* The cached value of the '{@link #getChangeDate() <em>Change Date</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getChangeDate()
* @generated
* @ordered
*/
protected XMLGregorianCalendar changeDate = CHANGE_DATE_EDEFAULT;
/**
* The default value of the '{@link #getChangeDescription() <em>Change Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getChangeDescription()
* @generated
* @ordered
*/
protected static final String CHANGE_DESCRIPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getChangeDescription() <em>Change Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getChangeDescription()
* @generated
* @ordered
*/
protected String changeDescription = CHANGE_DESCRIPTION_EDEFAULT;
/**
* The default value of the '{@link #getVersion() <em>Version</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVersion()
* @generated
* @ordered
*/
protected static final String VERSION_EDEFAULT = null;
/**
* The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVersion()
* @generated
* @ordered
*/
protected String version = VERSION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ProcessComponentImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UmaPackage.Literals.PROCESS_COMPONENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getCopyright() {
return copyright;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCopyright(String newCopyright) {
String oldCopyright = copyright;
copyright = newCopyright;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.PROCESS_COMPONENT__COPYRIGHT, oldCopyright, copyright));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ProcessComponentInterface getInterface() {
return interface_;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInterface(ProcessComponentInterface newInterface, NotificationChain msgs) {
ProcessComponentInterface oldInterface = interface_;
interface_ = newInterface;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UmaPackage.PROCESS_COMPONENT__INTERFACE, oldInterface, newInterface);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInterface(ProcessComponentInterface newInterface) {
if (newInterface != interface_) {
NotificationChain msgs = null;
if (interface_ != null)
msgs = ((InternalEObject)interface_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UmaPackage.PROCESS_COMPONENT__INTERFACE, null, msgs);
if (newInterface != null)
msgs = ((InternalEObject)newInterface).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UmaPackage.PROCESS_COMPONENT__INTERFACE, null, msgs);
msgs = basicSetInterface(newInterface, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.PROCESS_COMPONENT__INTERFACE, newInterface, newInterface));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.epf.xml.uma.Process getProcess() {
return process;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetProcess(org.eclipse.epf.xml.uma.Process newProcess, NotificationChain msgs) {
org.eclipse.epf.xml.uma.Process oldProcess = process;
process = newProcess;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UmaPackage.PROCESS_COMPONENT__PROCESS, oldProcess, newProcess);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setProcess(org.eclipse.epf.xml.uma.Process newProcess) {
if (newProcess != process) {
NotificationChain msgs = null;
if (process != null)
msgs = ((InternalEObject)process).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UmaPackage.PROCESS_COMPONENT__PROCESS, null, msgs);
if (newProcess != null)
msgs = ((InternalEObject)newProcess).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UmaPackage.PROCESS_COMPONENT__PROCESS, null, msgs);
msgs = basicSetProcess(newProcess, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.PROCESS_COMPONENT__PROCESS, newProcess, newProcess));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getAuthors() {
return authors;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAuthors(String newAuthors) {
String oldAuthors = authors;
authors = newAuthors;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.PROCESS_COMPONENT__AUTHORS, oldAuthors, authors));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public XMLGregorianCalendar getChangeDate() {
return changeDate;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setChangeDate(XMLGregorianCalendar newChangeDate) {
XMLGregorianCalendar oldChangeDate = changeDate;
changeDate = newChangeDate;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.PROCESS_COMPONENT__CHANGE_DATE, oldChangeDate, changeDate));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getChangeDescription() {
return changeDescription;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setChangeDescription(String newChangeDescription) {
String oldChangeDescription = changeDescription;
changeDescription = newChangeDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.PROCESS_COMPONENT__CHANGE_DESCRIPTION, oldChangeDescription, changeDescription));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getVersion() {
return version;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVersion(String newVersion) {
String oldVersion = version;
version = newVersion;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.PROCESS_COMPONENT__VERSION, oldVersion, version));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case UmaPackage.PROCESS_COMPONENT__INTERFACE:
return basicSetInterface(null, msgs);
case UmaPackage.PROCESS_COMPONENT__PROCESS:
return basicSetProcess(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 UmaPackage.PROCESS_COMPONENT__COPYRIGHT:
return getCopyright();
case UmaPackage.PROCESS_COMPONENT__INTERFACE:
return getInterface();
case UmaPackage.PROCESS_COMPONENT__PROCESS:
return getProcess();
case UmaPackage.PROCESS_COMPONENT__AUTHORS:
return getAuthors();
case UmaPackage.PROCESS_COMPONENT__CHANGE_DATE:
return getChangeDate();
case UmaPackage.PROCESS_COMPONENT__CHANGE_DESCRIPTION:
return getChangeDescription();
case UmaPackage.PROCESS_COMPONENT__VERSION:
return getVersion();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UmaPackage.PROCESS_COMPONENT__COPYRIGHT:
setCopyright((String)newValue);
return;
case UmaPackage.PROCESS_COMPONENT__INTERFACE:
setInterface((ProcessComponentInterface)newValue);
return;
case UmaPackage.PROCESS_COMPONENT__PROCESS:
setProcess((org.eclipse.epf.xml.uma.Process)newValue);
return;
case UmaPackage.PROCESS_COMPONENT__AUTHORS:
setAuthors((String)newValue);
return;
case UmaPackage.PROCESS_COMPONENT__CHANGE_DATE:
setChangeDate((XMLGregorianCalendar)newValue);
return;
case UmaPackage.PROCESS_COMPONENT__CHANGE_DESCRIPTION:
setChangeDescription((String)newValue);
return;
case UmaPackage.PROCESS_COMPONENT__VERSION:
setVersion((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case UmaPackage.PROCESS_COMPONENT__COPYRIGHT:
setCopyright(COPYRIGHT_EDEFAULT);
return;
case UmaPackage.PROCESS_COMPONENT__INTERFACE:
setInterface((ProcessComponentInterface)null);
return;
case UmaPackage.PROCESS_COMPONENT__PROCESS:
setProcess((org.eclipse.epf.xml.uma.Process)null);
return;
case UmaPackage.PROCESS_COMPONENT__AUTHORS:
setAuthors(AUTHORS_EDEFAULT);
return;
case UmaPackage.PROCESS_COMPONENT__CHANGE_DATE:
setChangeDate(CHANGE_DATE_EDEFAULT);
return;
case UmaPackage.PROCESS_COMPONENT__CHANGE_DESCRIPTION:
setChangeDescription(CHANGE_DESCRIPTION_EDEFAULT);
return;
case UmaPackage.PROCESS_COMPONENT__VERSION:
setVersion(VERSION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case UmaPackage.PROCESS_COMPONENT__COPYRIGHT:
return COPYRIGHT_EDEFAULT == null ? copyright != null : !COPYRIGHT_EDEFAULT.equals(copyright);
case UmaPackage.PROCESS_COMPONENT__INTERFACE:
return interface_ != null;
case UmaPackage.PROCESS_COMPONENT__PROCESS:
return process != null;
case UmaPackage.PROCESS_COMPONENT__AUTHORS:
return AUTHORS_EDEFAULT == null ? authors != null : !AUTHORS_EDEFAULT.equals(authors);
case UmaPackage.PROCESS_COMPONENT__CHANGE_DATE:
return CHANGE_DATE_EDEFAULT == null ? changeDate != null : !CHANGE_DATE_EDEFAULT.equals(changeDate);
case UmaPackage.PROCESS_COMPONENT__CHANGE_DESCRIPTION:
return CHANGE_DESCRIPTION_EDEFAULT == null ? changeDescription != null : !CHANGE_DESCRIPTION_EDEFAULT.equals(changeDescription);
case UmaPackage.PROCESS_COMPONENT__VERSION:
return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version);
}
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(" (copyright: ");
result.append(copyright);
result.append(", authors: ");
result.append(authors);
result.append(", changeDate: ");
result.append(changeDate);
result.append(", changeDescription: ");
result.append(changeDescription);
result.append(", version: ");
result.append(version);
result.append(')');
return result.toString();
}
} //ProcessComponentImpl