| /******************************************************************************* |
| * 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 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.Constraint; |
| import org.eclipse.epf.xml.uma.UmaPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Constraint</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.epf.xml.uma.impl.ConstraintImpl#getMainDescription <em>Main Description</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ConstraintImpl extends MethodElementImpl implements Constraint { |
| /** |
| * The default value of the '{@link #getMainDescription() <em>Main Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMainDescription() |
| * @generated |
| * @ordered |
| */ |
| protected static final String MAIN_DESCRIPTION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getMainDescription() <em>Main Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMainDescription() |
| * @generated |
| * @ordered |
| */ |
| protected String mainDescription = MAIN_DESCRIPTION_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ConstraintImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UmaPackage.Literals.CONSTRAINT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getMainDescription() { |
| return mainDescription; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMainDescription(String newMainDescription) { |
| String oldMainDescription = mainDescription; |
| mainDescription = newMainDescription; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.CONSTRAINT__MAIN_DESCRIPTION, oldMainDescription, mainDescription)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case UmaPackage.CONSTRAINT__MAIN_DESCRIPTION: |
| return getMainDescription(); |
| } |
| 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.CONSTRAINT__MAIN_DESCRIPTION: |
| setMainDescription((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case UmaPackage.CONSTRAINT__MAIN_DESCRIPTION: |
| setMainDescription(MAIN_DESCRIPTION_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case UmaPackage.CONSTRAINT__MAIN_DESCRIPTION: |
| return MAIN_DESCRIPTION_EDEFAULT == null ? mainDescription != null : !MAIN_DESCRIPTION_EDEFAULT.equals(mainDescription); |
| } |
| 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(" (mainDescription: "); |
| result.append(mainDescription); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ConstraintImpl |