| /******************************************************************************* |
| * Copyright (c) 2005, 2009 IBM Corporation and others. |
| * 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: |
| * IBM Corporation - initial implementation |
| *******************************************************************************/ |
| package org.eclipse.epf.xml.uma.impl; |
| |
| import javax.xml.datatype.XMLGregorianCalendar; |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.epf.xml.uma.MethodUnit; |
| import org.eclipse.epf.xml.uma.UmaPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Method Unit</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.epf.xml.uma.impl.MethodUnitImpl#getCopyright <em>Copyright</em>}</li> |
| * <li>{@link org.eclipse.epf.xml.uma.impl.MethodUnitImpl#getAuthors <em>Authors</em>}</li> |
| * <li>{@link org.eclipse.epf.xml.uma.impl.MethodUnitImpl#getChangeDate <em>Change Date</em>}</li> |
| * <li>{@link org.eclipse.epf.xml.uma.impl.MethodUnitImpl#getChangeDescription <em>Change Description</em>}</li> |
| * <li>{@link org.eclipse.epf.xml.uma.impl.MethodUnitImpl#getVersion <em>Version</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class MethodUnitImpl extends MethodElementImpl implements MethodUnit { |
| /** |
| * 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 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 MethodUnitImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UmaPackage.Literals.METHOD_UNIT; |
| } |
| |
| /** |
| * <!-- 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.METHOD_UNIT__COPYRIGHT, oldCopyright, copyright)); |
| } |
| |
| /** |
| * <!-- 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.METHOD_UNIT__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.METHOD_UNIT__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.METHOD_UNIT__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.METHOD_UNIT__VERSION, oldVersion, version)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case UmaPackage.METHOD_UNIT__COPYRIGHT: |
| return getCopyright(); |
| case UmaPackage.METHOD_UNIT__AUTHORS: |
| return getAuthors(); |
| case UmaPackage.METHOD_UNIT__CHANGE_DATE: |
| return getChangeDate(); |
| case UmaPackage.METHOD_UNIT__CHANGE_DESCRIPTION: |
| return getChangeDescription(); |
| case UmaPackage.METHOD_UNIT__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.METHOD_UNIT__COPYRIGHT: |
| setCopyright((String)newValue); |
| return; |
| case UmaPackage.METHOD_UNIT__AUTHORS: |
| setAuthors((String)newValue); |
| return; |
| case UmaPackage.METHOD_UNIT__CHANGE_DATE: |
| setChangeDate((XMLGregorianCalendar)newValue); |
| return; |
| case UmaPackage.METHOD_UNIT__CHANGE_DESCRIPTION: |
| setChangeDescription((String)newValue); |
| return; |
| case UmaPackage.METHOD_UNIT__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.METHOD_UNIT__COPYRIGHT: |
| setCopyright(COPYRIGHT_EDEFAULT); |
| return; |
| case UmaPackage.METHOD_UNIT__AUTHORS: |
| setAuthors(AUTHORS_EDEFAULT); |
| return; |
| case UmaPackage.METHOD_UNIT__CHANGE_DATE: |
| setChangeDate(CHANGE_DATE_EDEFAULT); |
| return; |
| case UmaPackage.METHOD_UNIT__CHANGE_DESCRIPTION: |
| setChangeDescription(CHANGE_DESCRIPTION_EDEFAULT); |
| return; |
| case UmaPackage.METHOD_UNIT__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.METHOD_UNIT__COPYRIGHT: |
| return COPYRIGHT_EDEFAULT == null ? copyright != null : !COPYRIGHT_EDEFAULT.equals(copyright); |
| case UmaPackage.METHOD_UNIT__AUTHORS: |
| return AUTHORS_EDEFAULT == null ? authors != null : !AUTHORS_EDEFAULT.equals(authors); |
| case UmaPackage.METHOD_UNIT__CHANGE_DATE: |
| return CHANGE_DATE_EDEFAULT == null ? changeDate != null : !CHANGE_DATE_EDEFAULT.equals(changeDate); |
| case UmaPackage.METHOD_UNIT__CHANGE_DESCRIPTION: |
| return CHANGE_DESCRIPTION_EDEFAULT == null ? changeDescription != null : !CHANGE_DESCRIPTION_EDEFAULT.equals(changeDescription); |
| case UmaPackage.METHOD_UNIT__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(); |
| } |
| |
| } //MethodUnitImpl |