| /** |
| */ |
| package org.eclipse.osee.framework.core.dsl.oseeDsl.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessPermissionEnum; |
| import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction; |
| import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDslPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Object Restriction</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osee.framework.core.dsl.oseeDsl.impl.ObjectRestrictionImpl#getPermission <em>Permission</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ObjectRestrictionImpl extends MinimalEObjectImpl.Container implements ObjectRestriction |
| { |
| /** |
| * The default value of the '{@link #getPermission() <em>Permission</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPermission() |
| * @generated |
| * @ordered |
| */ |
| protected static final AccessPermissionEnum PERMISSION_EDEFAULT = AccessPermissionEnum.ALLOW; |
| |
| /** |
| * The cached value of the '{@link #getPermission() <em>Permission</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPermission() |
| * @generated |
| * @ordered |
| */ |
| protected AccessPermissionEnum permission = PERMISSION_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ObjectRestrictionImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return OseeDslPackage.Literals.OBJECT_RESTRICTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public AccessPermissionEnum getPermission() |
| { |
| return permission; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPermission(AccessPermissionEnum newPermission) |
| { |
| AccessPermissionEnum oldPermission = permission; |
| permission = newPermission == null ? PERMISSION_EDEFAULT : newPermission; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OseeDslPackage.OBJECT_RESTRICTION__PERMISSION, oldPermission, permission)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.OBJECT_RESTRICTION__PERMISSION: |
| return getPermission(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.OBJECT_RESTRICTION__PERMISSION: |
| setPermission((AccessPermissionEnum)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.OBJECT_RESTRICTION__PERMISSION: |
| setPermission(PERMISSION_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.OBJECT_RESTRICTION__PERMISSION: |
| return permission != PERMISSION_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(" (permission: "); |
| result.append(permission); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ObjectRestrictionImpl |