| /******************************************************************************* |
| * Copyright (c) 2012, 2015 Willink Transformations and others. |
| * 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 |
| * |
| * Contributors: |
| * E.D.Willink - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.qvtd.xtext.qvtcorebasecs.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.jdt.annotation.NonNull; |
| import org.eclipse.jdt.annotation.Nullable; |
| import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor; |
| import org.eclipse.qvtd.pivot.qvtbase.TypedModel; |
| import org.eclipse.qvtd.xtext.qvtcorebasecs.DomainCS; |
| import org.eclipse.qvtd.xtext.qvtcorebasecs.QVTcoreBaseCSPackage; |
| import org.eclipse.qvtd.xtext.qvtcorebasecs.util.QVTcoreBaseCSVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Domain CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtcorebasecs.impl.DomainCSImpl#isIsCheck <em>Is Check</em>}</li> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtcorebasecs.impl.DomainCSImpl#isIsEnforce <em>Is Enforce</em>}</li> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtcorebasecs.impl.DomainCSImpl#getDirection <em>Direction</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DomainCSImpl extends AreaCSImpl implements DomainCS { |
| /** |
| * The default value of the '{@link #isIsCheck() <em>Is Check</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsCheck() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean IS_CHECK_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isIsCheck() <em>Is Check</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsCheck() |
| * @generated |
| * @ordered |
| */ |
| protected boolean isCheck = IS_CHECK_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isIsEnforce() <em>Is Enforce</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsEnforce() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean IS_ENFORCE_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isIsEnforce() <em>Is Enforce</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsEnforce() |
| * @generated |
| * @ordered |
| */ |
| protected boolean isEnforce = IS_ENFORCE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getDirection() <em>Direction</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDirection() |
| * @generated |
| * @ordered |
| */ |
| protected TypedModel direction; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DomainCSImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return QVTcoreBaseCSPackage.Literals.DOMAIN_CS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isIsCheck() { |
| return isCheck; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setIsCheck(boolean newIsCheck) { |
| boolean oldIsCheck = isCheck; |
| isCheck = newIsCheck; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, QVTcoreBaseCSPackage.DOMAIN_CS__IS_CHECK, oldIsCheck, isCheck)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isIsEnforce() { |
| return isEnforce; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setIsEnforce(boolean newIsEnforce) { |
| boolean oldIsEnforce = isEnforce; |
| isEnforce = newIsEnforce; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, QVTcoreBaseCSPackage.DOMAIN_CS__IS_ENFORCE, oldIsEnforce, isEnforce)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public TypedModel getDirection() { |
| if (direction != null && direction.eIsProxy()) { |
| InternalEObject oldDirection = (InternalEObject)direction; |
| direction = (TypedModel)eResolveProxy(oldDirection); |
| if (direction != oldDirection) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, QVTcoreBaseCSPackage.DOMAIN_CS__DIRECTION, oldDirection, direction)); |
| } |
| } |
| return direction; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public TypedModel basicGetDirection() { |
| return direction; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setDirection(TypedModel newDirection) { |
| TypedModel oldDirection = direction; |
| direction = newDirection; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, QVTcoreBaseCSPackage.DOMAIN_CS__DIRECTION, oldDirection, direction)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| return super.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case QVTcoreBaseCSPackage.DOMAIN_CS__IS_CHECK: |
| return isIsCheck(); |
| case QVTcoreBaseCSPackage.DOMAIN_CS__IS_ENFORCE: |
| return isIsEnforce(); |
| case QVTcoreBaseCSPackage.DOMAIN_CS__DIRECTION: |
| if (resolve) return getDirection(); |
| return basicGetDirection(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case QVTcoreBaseCSPackage.DOMAIN_CS__IS_CHECK: |
| setIsCheck((Boolean)newValue); |
| return; |
| case QVTcoreBaseCSPackage.DOMAIN_CS__IS_ENFORCE: |
| setIsEnforce((Boolean)newValue); |
| return; |
| case QVTcoreBaseCSPackage.DOMAIN_CS__DIRECTION: |
| setDirection((TypedModel)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case QVTcoreBaseCSPackage.DOMAIN_CS__IS_CHECK: |
| setIsCheck(IS_CHECK_EDEFAULT); |
| return; |
| case QVTcoreBaseCSPackage.DOMAIN_CS__IS_ENFORCE: |
| setIsEnforce(IS_ENFORCE_EDEFAULT); |
| return; |
| case QVTcoreBaseCSPackage.DOMAIN_CS__DIRECTION: |
| setDirection((TypedModel)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case QVTcoreBaseCSPackage.DOMAIN_CS__IS_CHECK: |
| return isCheck != IS_CHECK_EDEFAULT; |
| case QVTcoreBaseCSPackage.DOMAIN_CS__IS_ENFORCE: |
| return isEnforce != IS_ENFORCE_EDEFAULT; |
| case QVTcoreBaseCSPackage.DOMAIN_CS__DIRECTION: |
| return direction != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public @Nullable <R> R accept(@NonNull BaseCSVisitor<R> visitor) { |
| return (R) ((QVTcoreBaseCSVisitor<?>)visitor).visitDomainCS(this); |
| } |
| } //DomainCSImpl |