| /** |
| * 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: |
| * Jose C. Dominguez - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.organizationdsl.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.xtext.authorizationdsl.Role; |
| |
| import org.eclipse.osbp.xtext.organizationdsl.OrganizationDSLPackage; |
| import org.eclipse.osbp.xtext.organizationdsl.OrganizationRole; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Organization Role</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.organizationdsl.impl.OrganizationRoleImpl#getRole <em>Role</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class OrganizationRoleImpl extends OrganizationLazyResolverImpl implements OrganizationRole { |
| /** |
| * The cached value of the '{@link #getRole() <em>Role</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRole() |
| * @generated |
| * @ordered |
| */ |
| protected Role role; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected OrganizationRoleImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return OrganizationDSLPackage.Literals.ORGANIZATION_ROLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Role getRole() { |
| if (role != null && role.eIsProxy()) { |
| InternalEObject oldRole = (InternalEObject)role; |
| role = (Role)eResolveProxy(oldRole); |
| if (role != oldRole) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, OrganizationDSLPackage.ORGANIZATION_ROLE__ROLE, oldRole, role)); |
| } |
| } |
| return role; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Role basicGetRole() { |
| return role; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRole(Role newRole) { |
| Role oldRole = role; |
| role = newRole; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OrganizationDSLPackage.ORGANIZATION_ROLE__ROLE, oldRole, role)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case OrganizationDSLPackage.ORGANIZATION_ROLE__ROLE: |
| if (resolve) return getRole(); |
| return basicGetRole(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case OrganizationDSLPackage.ORGANIZATION_ROLE__ROLE: |
| setRole((Role)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case OrganizationDSLPackage.ORGANIZATION_ROLE__ROLE: |
| setRole((Role)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case OrganizationDSLPackage.ORGANIZATION_ROLE__ROLE: |
| return role != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //OrganizationRoleImpl |