| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.entitymock.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.dsl.semantic.common.types.LEnum; |
| |
| import org.eclipse.osbp.xtext.entitymock.EntityMockDSLPackage; |
| import org.eclipse.osbp.xtext.entitymock.EntityMockObjectEnum; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Entity Mock Object Enum</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockObjectEnumImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockObjectEnumImpl#getUsingResource <em>Using Resource</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class EntityMockObjectEnumImpl extends IEntityMockObjectUsableImpl implements EntityMockObjectEnum { |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getUsingResource() <em>Using Resource</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUsingResource() |
| * @generated |
| * @ordered |
| */ |
| protected LEnum usingResource; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EntityMockObjectEnumImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return EntityMockDSLPackage.Literals.ENTITY_MOCK_OBJECT_ENUM; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEnum getUsingResource() { |
| if (usingResource != null && usingResource.eIsProxy()) { |
| InternalEObject oldUsingResource = (InternalEObject)usingResource; |
| usingResource = (LEnum)eResolveProxy(oldUsingResource); |
| if (usingResource != oldUsingResource) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__USING_RESOURCE, oldUsingResource, usingResource)); |
| } |
| } |
| return usingResource; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEnum basicGetUsingResource() { |
| return usingResource; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUsingResource(LEnum newUsingResource) { |
| LEnum oldUsingResource = usingResource; |
| usingResource = newUsingResource; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__USING_RESOURCE, oldUsingResource, usingResource)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__NAME: |
| return getName(); |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__USING_RESOURCE: |
| if (resolve) return getUsingResource(); |
| return basicGetUsingResource(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__NAME: |
| setName((String)newValue); |
| return; |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__USING_RESOURCE: |
| setUsingResource((LEnum)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__USING_RESOURCE: |
| setUsingResource((LEnum)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_ENUM__USING_RESOURCE: |
| return usingResource != null; |
| } |
| 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(" (name: "); |
| result.append(name); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //EntityMockObjectEnumImpl |