| /** |
| * 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 java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EDataTypeEList; |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.osbp.dsl.semantic.dto.LDto; |
| |
| import org.eclipse.osbp.xtext.authorizationdsl.AuthorizationDSLPackage; |
| import org.eclipse.osbp.xtext.authorizationdsl.RoleDto; |
| import org.eclipse.osbp.xtext.authorizationdsl.RoleDtoFeature; |
| import org.eclipse.osbp.xtext.authorizationdsl.RoleEnum; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Role Dto</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.authorizationdsl.impl.RoleDtoImpl#getDtoAuthorized <em>Dto Authorized</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.authorizationdsl.impl.RoleDtoImpl#getDtoFeatures <em>Dto Features</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.authorizationdsl.impl.RoleDtoImpl#getDtoRef <em>Dto Ref</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class RoleDtoImpl extends RoleElementImpl implements RoleDto { |
| /** |
| * The cached value of the '{@link #getDtoAuthorized() <em>Dto Authorized</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDtoAuthorized() |
| * @generated |
| * @ordered |
| */ |
| protected EList<RoleEnum> dtoAuthorized; |
| |
| /** |
| * The cached value of the '{@link #getDtoFeatures() <em>Dto Features</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDtoFeatures() |
| * @generated |
| * @ordered |
| */ |
| protected EList<RoleDtoFeature> dtoFeatures; |
| |
| /** |
| * The cached value of the '{@link #getDtoRef() <em>Dto Ref</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDtoRef() |
| * @generated |
| * @ordered |
| */ |
| protected LDto dtoRef; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected RoleDtoImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AuthorizationDSLPackage.Literals.ROLE_DTO; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<RoleEnum> getDtoAuthorized() { |
| if (dtoAuthorized == null) { |
| dtoAuthorized = new EDataTypeEList<RoleEnum>(RoleEnum.class, this, AuthorizationDSLPackage.ROLE_DTO__DTO_AUTHORIZED); |
| } |
| return dtoAuthorized; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<RoleDtoFeature> getDtoFeatures() { |
| if (dtoFeatures == null) { |
| dtoFeatures = new EObjectContainmentEList<RoleDtoFeature>(RoleDtoFeature.class, this, AuthorizationDSLPackage.ROLE_DTO__DTO_FEATURES); |
| } |
| return dtoFeatures; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LDto getDtoRef() { |
| if (dtoRef != null && dtoRef.eIsProxy()) { |
| InternalEObject oldDtoRef = (InternalEObject)dtoRef; |
| dtoRef = (LDto)eResolveProxy(oldDtoRef); |
| if (dtoRef != oldDtoRef) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, AuthorizationDSLPackage.ROLE_DTO__DTO_REF, oldDtoRef, dtoRef)); |
| } |
| } |
| return dtoRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LDto basicGetDtoRef() { |
| return dtoRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDtoRef(LDto newDtoRef) { |
| LDto oldDtoRef = dtoRef; |
| dtoRef = newDtoRef; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AuthorizationDSLPackage.ROLE_DTO__DTO_REF, oldDtoRef, dtoRef)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_FEATURES: |
| return ((InternalEList<?>)getDtoFeatures()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_AUTHORIZED: |
| return getDtoAuthorized(); |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_FEATURES: |
| return getDtoFeatures(); |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_REF: |
| if (resolve) return getDtoRef(); |
| return basicGetDtoRef(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_AUTHORIZED: |
| getDtoAuthorized().clear(); |
| getDtoAuthorized().addAll((Collection<? extends RoleEnum>)newValue); |
| return; |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_FEATURES: |
| getDtoFeatures().clear(); |
| getDtoFeatures().addAll((Collection<? extends RoleDtoFeature>)newValue); |
| return; |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_REF: |
| setDtoRef((LDto)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_AUTHORIZED: |
| getDtoAuthorized().clear(); |
| return; |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_FEATURES: |
| getDtoFeatures().clear(); |
| return; |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_REF: |
| setDtoRef((LDto)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_AUTHORIZED: |
| return dtoAuthorized != null && !dtoAuthorized.isEmpty(); |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_FEATURES: |
| return dtoFeatures != null && !dtoFeatures.isEmpty(); |
| case AuthorizationDSLPackage.ROLE_DTO__DTO_REF: |
| return dtoRef != 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(" (dtoAuthorized: "); |
| result.append(dtoAuthorized); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //RoleDtoImpl |