/******************************************************************************* * Copyright (c) 2001, 2004 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 API and implementation *******************************************************************************/ package org.eclipse.jst.j2ee.internal.common.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.jst.j2ee.common.DisplayName; import org.eclipse.jst.j2ee.internal.common.CommonPackage; /** * * An implementation of the model object 'Display Name'. * *

* The following features are implemented: *

*

* * @generated */ public class DisplayNameImpl extends EObjectImpl implements DisplayName { /** * The default value of the '{@link #getLang() Lang}' attribute. * * * @see #getLang() * @generated * @ordered */ protected static final String LANG_EDEFAULT = null; /** * The cached value of the '{@link #getLang() Lang}' attribute. * * * @see #getLang() * @generated * @ordered */ protected String lang = LANG_EDEFAULT; /** * The default value of the '{@link #getValue() Value}' attribute. * * * @see #getValue() * @generated * @ordered */ protected static final String VALUE_EDEFAULT = null; /** * The cached value of the '{@link #getValue() Value}' attribute. * * * @see #getValue() * @generated * @ordered */ protected String value = VALUE_EDEFAULT; /** * * * @generated */ protected DisplayNameImpl() { super(); } /** * * * @generated */ protected EClass eStaticClass() { return CommonPackage.eINSTANCE.getDisplayName(); } /** * * * @generated */ public String getLang() { return lang; } /** * * * @generated */ public void setLang(String newLang) { String oldLang = lang; lang = newLang; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CommonPackage.DISPLAY_NAME__LANG, oldLang, lang)); } /** * * * @generated */ public String getValue() { return value; } /** * * * @generated */ public void setValue(String newValue) { String oldValue = value; value = newValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CommonPackage.DISPLAY_NAME__VALUE, oldValue, value)); } /** * * * @generated */ public Object eGet(EStructuralFeature eFeature, boolean resolve) { switch (eDerivedStructuralFeatureID(eFeature)) { case CommonPackage.DISPLAY_NAME__LANG: return getLang(); case CommonPackage.DISPLAY_NAME__VALUE: return getValue(); } return eDynamicGet(eFeature, resolve); } /** * * * @generated */ public void eSet(EStructuralFeature eFeature, Object newValue) { switch (eDerivedStructuralFeatureID(eFeature)) { case CommonPackage.DISPLAY_NAME__LANG: setLang((String)newValue); return; case CommonPackage.DISPLAY_NAME__VALUE: setValue((String)newValue); return; } eDynamicSet(eFeature, newValue); } /** * * * @generated */ public void eUnset(EStructuralFeature eFeature) { switch (eDerivedStructuralFeatureID(eFeature)) { case CommonPackage.DISPLAY_NAME__LANG: setLang(LANG_EDEFAULT); return; case CommonPackage.DISPLAY_NAME__VALUE: setValue(VALUE_EDEFAULT); return; } eDynamicUnset(eFeature); } /** * * * @generated */ public boolean eIsSet(EStructuralFeature eFeature) { switch (eDerivedStructuralFeatureID(eFeature)) { case CommonPackage.DISPLAY_NAME__LANG: return LANG_EDEFAULT == null ? lang != null : !LANG_EDEFAULT.equals(lang); case CommonPackage.DISPLAY_NAME__VALUE: return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); } return eDynamicIsSet(eFeature); } /** * * * @generated */ public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (lang: "); //$NON-NLS-1$ result.append(lang); result.append(", value: "); //$NON-NLS-1$ result.append(value); result.append(')'); return result.toString(); } } //DisplayNameImpl