| /******************************************************************************* |
| * Copyright (c) 2003, 2005 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.jem.internal.instantiation.impl; |
| /* |
| * $RCSfile: InitStringAllocationImpl.java,v $ |
| * $Revision: 1.8 $ $Date: 2005/09/15 21:02:19 $ |
| */ |
| |
| 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.jem.internal.instantiation.InitStringAllocation; |
| import org.eclipse.jem.internal.instantiation.InstantiationPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Init String Allocation</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jem.internal.instantiation.impl.InitStringAllocationImpl#getInitString <em>Init String</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class InitStringAllocationImpl extends JavaAllocationImpl implements InitStringAllocation { |
| /** |
| * The default value of the '{@link #getInitString() <em>Init String</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getInitString() |
| * @generated |
| * @ordered |
| */ |
| protected static final String INIT_STRING_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getInitString() <em>Init String</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getInitString() |
| * @generated |
| * @ordered |
| */ |
| protected String initString = INIT_STRING_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected InitStringAllocationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return InstantiationPackage.eINSTANCE.getInitStringAllocation(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getInitString() { |
| return initString; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setInitString(String newInitString) { |
| String oldInitString = initString; |
| initString = newInitString; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, InstantiationPackage.INIT_STRING_ALLOCATION__INIT_STRING, oldInitString, initString)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(EStructuralFeature eFeature, boolean resolve) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case InstantiationPackage.INIT_STRING_ALLOCATION__INIT_STRING: |
| return getInitString(); |
| } |
| return eDynamicGet(eFeature, resolve); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(EStructuralFeature eFeature, Object newValue) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case InstantiationPackage.INIT_STRING_ALLOCATION__INIT_STRING: |
| setInitString((String)newValue); |
| return; |
| } |
| eDynamicSet(eFeature, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case InstantiationPackage.INIT_STRING_ALLOCATION__INIT_STRING: |
| setInitString(INIT_STRING_EDEFAULT); |
| return; |
| } |
| eDynamicUnset(eFeature); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case InstantiationPackage.INIT_STRING_ALLOCATION__INIT_STRING: |
| return INIT_STRING_EDEFAULT == null ? initString != null : !INIT_STRING_EDEFAULT.equals(initString); |
| } |
| return eDynamicIsSet(eFeature); |
| } |
| |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(); |
| result.append("InitString: "); |
| result.append(initString); |
| return result.toString(); |
| } |
| |
| } //InitStringAllocationImpl |