| /** |
| * 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 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| * generated from AuthoritarionDSL.xcore |
| * |
| * |
| */ |
| package org.eclipse.osbp.xtext.authorizationdsl.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.AuthorizationDSLPackage; |
| import org.eclipse.osbp.xtext.authorizationdsl.RoleBlipUserTask; |
| import org.eclipse.osbp.xtext.authorizationdsl.RoleBlipUserTaskEnum; |
| |
| import org.eclipse.osbp.xtext.blip.BlipUserTask; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Role Blip User Task</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.authorizationdsl.impl.RoleBlipUserTaskImpl#getUserTask <em>User Task</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.authorizationdsl.impl.RoleBlipUserTaskImpl#getAuthorized <em>Authorized</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class RoleBlipUserTaskImpl extends RoleElementImpl implements RoleBlipUserTask { |
| /** |
| * The cached value of the '{@link #getUserTask() <em>User Task</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUserTask() |
| * @generated |
| * @ordered |
| */ |
| protected BlipUserTask userTask; |
| |
| /** |
| * The default value of the '{@link #getAuthorized() <em>Authorized</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAuthorized() |
| * @generated |
| * @ordered |
| */ |
| protected static final RoleBlipUserTaskEnum AUTHORIZED_EDEFAULT = RoleBlipUserTaskEnum.EXECUTABLE; |
| |
| /** |
| * The cached value of the '{@link #getAuthorized() <em>Authorized</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAuthorized() |
| * @generated |
| * @ordered |
| */ |
| protected RoleBlipUserTaskEnum authorized = AUTHORIZED_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected RoleBlipUserTaskImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AuthorizationDSLPackage.Literals.ROLE_BLIP_USER_TASK; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BlipUserTask getUserTask() { |
| if (userTask != null && userTask.eIsProxy()) { |
| InternalEObject oldUserTask = (InternalEObject)userTask; |
| userTask = (BlipUserTask)eResolveProxy(oldUserTask); |
| if (userTask != oldUserTask) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__USER_TASK, oldUserTask, userTask)); |
| } |
| } |
| return userTask; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BlipUserTask basicGetUserTask() { |
| return userTask; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUserTask(BlipUserTask newUserTask) { |
| BlipUserTask oldUserTask = userTask; |
| userTask = newUserTask; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__USER_TASK, oldUserTask, userTask)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public RoleBlipUserTaskEnum getAuthorized() { |
| return authorized; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAuthorized(RoleBlipUserTaskEnum newAuthorized) { |
| RoleBlipUserTaskEnum oldAuthorized = authorized; |
| authorized = newAuthorized == null ? AUTHORIZED_EDEFAULT : newAuthorized; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__AUTHORIZED, oldAuthorized, authorized)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__USER_TASK: |
| if (resolve) return getUserTask(); |
| return basicGetUserTask(); |
| case AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__AUTHORIZED: |
| return getAuthorized(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__USER_TASK: |
| setUserTask((BlipUserTask)newValue); |
| return; |
| case AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__AUTHORIZED: |
| setAuthorized((RoleBlipUserTaskEnum)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__USER_TASK: |
| setUserTask((BlipUserTask)null); |
| return; |
| case AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__AUTHORIZED: |
| setAuthorized(AUTHORIZED_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__USER_TASK: |
| return userTask != null; |
| case AuthorizationDSLPackage.ROLE_BLIP_USER_TASK__AUTHORIZED: |
| return authorized != AUTHORIZED_EDEFAULT; |
| } |
| 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(" (authorized: "); |
| result.append(authorized); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //RoleBlipUserTaskImpl |