blob: 67f32737c5e329984ee483a9c53a9edd73615883 [file] [log] [blame]
/**
* 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.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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.osbp.xtext.authorizationdsl.AuthorizationDSLPackage;
import org.eclipse.osbp.xtext.authorizationdsl.Role;
import org.eclipse.osbp.xtext.authorizationdsl.RoleElement;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Role</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.authorizationdsl.impl.RoleImpl#getRoleElements <em>Role Elements</em>}</li>
* </ul>
*
* @generated
*/
public class RoleImpl extends AuthorizationBaseImpl implements Role {
/**
* The cached value of the '{@link #getRoleElements() <em>Role Elements</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRoleElements()
* @generated
* @ordered
*/
protected EList<RoleElement> roleElements;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RoleImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AuthorizationDSLPackage.Literals.ROLE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<RoleElement> getRoleElements() {
if (roleElements == null) {
roleElements = new EObjectContainmentEList<RoleElement>(RoleElement.class, this, AuthorizationDSLPackage.ROLE__ROLE_ELEMENTS);
}
return roleElements;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AuthorizationDSLPackage.ROLE__ROLE_ELEMENTS:
return ((InternalEList<?>)getRoleElements()).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__ROLE_ELEMENTS:
return getRoleElements();
}
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__ROLE_ELEMENTS:
getRoleElements().clear();
getRoleElements().addAll((Collection<? extends RoleElement>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AuthorizationDSLPackage.ROLE__ROLE_ELEMENTS:
getRoleElements().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AuthorizationDSLPackage.ROLE__ROLE_ELEMENTS:
return roleElements != null && !roleElements.isEmpty();
}
return super.eIsSet(featureID);
}
} //RoleImpl