| /** |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.datamartdsl.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.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.osbp.dsl.semantic.entity.LEntity; |
| |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartAttribute; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartCondition; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartEntity; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartNavigation; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartOrder; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Datamart Entity</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartEntityImpl#getEntityRef <em>Entity Ref</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartEntityImpl#getNavigations <em>Navigations</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartEntityImpl#getAttributes <em>Attributes</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartEntityImpl#getConditions <em>Conditions</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartEntityImpl#getOrdering <em>Ordering</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartEntityImpl#isSuppressAttributes <em>Suppress Attributes</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartEntityImpl#getFillerMinCountRows <em>Filler Min Count Rows</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartEntityImpl#getFillerMaxCountRows <em>Filler Max Count Rows</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartEntityImpl#isTracking <em>Tracking</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DatamartEntityImpl extends DatamartLazyResolverImpl implements DatamartEntity { |
| /** |
| * The cached value of the '{@link #getEntityRef() <em>Entity Ref</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEntityRef() |
| * @generated |
| * @ordered |
| */ |
| protected LEntity entityRef; |
| |
| /** |
| * The cached value of the '{@link #getNavigations() <em>Navigations</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNavigations() |
| * @generated |
| * @ordered |
| */ |
| protected EList<DatamartNavigation> navigations; |
| |
| /** |
| * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAttributes() |
| * @generated |
| * @ordered |
| */ |
| protected EList<DatamartAttribute> attributes; |
| |
| /** |
| * The cached value of the '{@link #getConditions() <em>Conditions</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getConditions() |
| * @generated |
| * @ordered |
| */ |
| protected EList<DatamartCondition> conditions; |
| |
| /** |
| * The cached value of the '{@link #getOrdering() <em>Ordering</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOrdering() |
| * @generated |
| * @ordered |
| */ |
| protected EList<DatamartOrder> ordering; |
| |
| /** |
| * The default value of the '{@link #isSuppressAttributes() <em>Suppress Attributes</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isSuppressAttributes() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean SUPPRESS_ATTRIBUTES_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isSuppressAttributes() <em>Suppress Attributes</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isSuppressAttributes() |
| * @generated |
| * @ordered |
| */ |
| protected boolean suppressAttributes = SUPPRESS_ATTRIBUTES_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getFillerMinCountRows() <em>Filler Min Count Rows</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFillerMinCountRows() |
| * @generated |
| * @ordered |
| */ |
| protected static final int FILLER_MIN_COUNT_ROWS_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getFillerMinCountRows() <em>Filler Min Count Rows</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFillerMinCountRows() |
| * @generated |
| * @ordered |
| */ |
| protected int fillerMinCountRows = FILLER_MIN_COUNT_ROWS_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getFillerMaxCountRows() <em>Filler Max Count Rows</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFillerMaxCountRows() |
| * @generated |
| * @ordered |
| */ |
| protected static final int FILLER_MAX_COUNT_ROWS_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getFillerMaxCountRows() <em>Filler Max Count Rows</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFillerMaxCountRows() |
| * @generated |
| * @ordered |
| */ |
| protected int fillerMaxCountRows = FILLER_MAX_COUNT_ROWS_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isTracking() <em>Tracking</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isTracking() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean TRACKING_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isTracking() <em>Tracking</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isTracking() |
| * @generated |
| * @ordered |
| */ |
| protected boolean tracking = TRACKING_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DatamartEntityImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DatamartDSLPackage.Literals.DATAMART_ENTITY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntity getEntityRef() { |
| if (entityRef != null && entityRef.eIsProxy()) { |
| InternalEObject oldEntityRef = (InternalEObject)entityRef; |
| entityRef = (LEntity)eResolveProxy(oldEntityRef); |
| if (entityRef != oldEntityRef) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DatamartDSLPackage.DATAMART_ENTITY__ENTITY_REF, oldEntityRef, entityRef)); |
| } |
| } |
| return entityRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntity basicGetEntityRef() { |
| return entityRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEntityRef(LEntity newEntityRef) { |
| LEntity oldEntityRef = entityRef; |
| entityRef = newEntityRef; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ENTITY__ENTITY_REF, oldEntityRef, entityRef)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<DatamartNavigation> getNavigations() { |
| if (navigations == null) { |
| navigations = new EObjectContainmentEList<DatamartNavigation>(DatamartNavigation.class, this, DatamartDSLPackage.DATAMART_ENTITY__NAVIGATIONS); |
| } |
| return navigations; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<DatamartAttribute> getAttributes() { |
| if (attributes == null) { |
| attributes = new EObjectContainmentEList<DatamartAttribute>(DatamartAttribute.class, this, DatamartDSLPackage.DATAMART_ENTITY__ATTRIBUTES); |
| } |
| return attributes; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<DatamartCondition> getConditions() { |
| if (conditions == null) { |
| conditions = new EObjectContainmentEList<DatamartCondition>(DatamartCondition.class, this, DatamartDSLPackage.DATAMART_ENTITY__CONDITIONS); |
| } |
| return conditions; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<DatamartOrder> getOrdering() { |
| if (ordering == null) { |
| ordering = new EObjectContainmentEList<DatamartOrder>(DatamartOrder.class, this, DatamartDSLPackage.DATAMART_ENTITY__ORDERING); |
| } |
| return ordering; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isSuppressAttributes() { |
| return suppressAttributes; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSuppressAttributes(boolean newSuppressAttributes) { |
| boolean oldSuppressAttributes = suppressAttributes; |
| suppressAttributes = newSuppressAttributes; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ENTITY__SUPPRESS_ATTRIBUTES, oldSuppressAttributes, suppressAttributes)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getFillerMinCountRows() { |
| return fillerMinCountRows; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFillerMinCountRows(int newFillerMinCountRows) { |
| int oldFillerMinCountRows = fillerMinCountRows; |
| fillerMinCountRows = newFillerMinCountRows; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ENTITY__FILLER_MIN_COUNT_ROWS, oldFillerMinCountRows, fillerMinCountRows)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getFillerMaxCountRows() { |
| return fillerMaxCountRows; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFillerMaxCountRows(int newFillerMaxCountRows) { |
| int oldFillerMaxCountRows = fillerMaxCountRows; |
| fillerMaxCountRows = newFillerMaxCountRows; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ENTITY__FILLER_MAX_COUNT_ROWS, oldFillerMaxCountRows, fillerMaxCountRows)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isTracking() { |
| return tracking; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTracking(boolean newTracking) { |
| boolean oldTracking = tracking; |
| tracking = newTracking; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ENTITY__TRACKING, oldTracking, tracking)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_ENTITY__NAVIGATIONS: |
| return ((InternalEList<?>)getNavigations()).basicRemove(otherEnd, msgs); |
| case DatamartDSLPackage.DATAMART_ENTITY__ATTRIBUTES: |
| return ((InternalEList<?>)getAttributes()).basicRemove(otherEnd, msgs); |
| case DatamartDSLPackage.DATAMART_ENTITY__CONDITIONS: |
| return ((InternalEList<?>)getConditions()).basicRemove(otherEnd, msgs); |
| case DatamartDSLPackage.DATAMART_ENTITY__ORDERING: |
| return ((InternalEList<?>)getOrdering()).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 DatamartDSLPackage.DATAMART_ENTITY__ENTITY_REF: |
| if (resolve) return getEntityRef(); |
| return basicGetEntityRef(); |
| case DatamartDSLPackage.DATAMART_ENTITY__NAVIGATIONS: |
| return getNavigations(); |
| case DatamartDSLPackage.DATAMART_ENTITY__ATTRIBUTES: |
| return getAttributes(); |
| case DatamartDSLPackage.DATAMART_ENTITY__CONDITIONS: |
| return getConditions(); |
| case DatamartDSLPackage.DATAMART_ENTITY__ORDERING: |
| return getOrdering(); |
| case DatamartDSLPackage.DATAMART_ENTITY__SUPPRESS_ATTRIBUTES: |
| return isSuppressAttributes(); |
| case DatamartDSLPackage.DATAMART_ENTITY__FILLER_MIN_COUNT_ROWS: |
| return getFillerMinCountRows(); |
| case DatamartDSLPackage.DATAMART_ENTITY__FILLER_MAX_COUNT_ROWS: |
| return getFillerMaxCountRows(); |
| case DatamartDSLPackage.DATAMART_ENTITY__TRACKING: |
| return isTracking(); |
| } |
| 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 DatamartDSLPackage.DATAMART_ENTITY__ENTITY_REF: |
| setEntityRef((LEntity)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__NAVIGATIONS: |
| getNavigations().clear(); |
| getNavigations().addAll((Collection<? extends DatamartNavigation>)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__ATTRIBUTES: |
| getAttributes().clear(); |
| getAttributes().addAll((Collection<? extends DatamartAttribute>)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__CONDITIONS: |
| getConditions().clear(); |
| getConditions().addAll((Collection<? extends DatamartCondition>)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__ORDERING: |
| getOrdering().clear(); |
| getOrdering().addAll((Collection<? extends DatamartOrder>)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__SUPPRESS_ATTRIBUTES: |
| setSuppressAttributes((Boolean)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__FILLER_MIN_COUNT_ROWS: |
| setFillerMinCountRows((Integer)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__FILLER_MAX_COUNT_ROWS: |
| setFillerMaxCountRows((Integer)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__TRACKING: |
| setTracking((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_ENTITY__ENTITY_REF: |
| setEntityRef((LEntity)null); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__NAVIGATIONS: |
| getNavigations().clear(); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__ATTRIBUTES: |
| getAttributes().clear(); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__CONDITIONS: |
| getConditions().clear(); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__ORDERING: |
| getOrdering().clear(); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__SUPPRESS_ATTRIBUTES: |
| setSuppressAttributes(SUPPRESS_ATTRIBUTES_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__FILLER_MIN_COUNT_ROWS: |
| setFillerMinCountRows(FILLER_MIN_COUNT_ROWS_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__FILLER_MAX_COUNT_ROWS: |
| setFillerMaxCountRows(FILLER_MAX_COUNT_ROWS_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_ENTITY__TRACKING: |
| setTracking(TRACKING_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_ENTITY__ENTITY_REF: |
| return entityRef != null; |
| case DatamartDSLPackage.DATAMART_ENTITY__NAVIGATIONS: |
| return navigations != null && !navigations.isEmpty(); |
| case DatamartDSLPackage.DATAMART_ENTITY__ATTRIBUTES: |
| return attributes != null && !attributes.isEmpty(); |
| case DatamartDSLPackage.DATAMART_ENTITY__CONDITIONS: |
| return conditions != null && !conditions.isEmpty(); |
| case DatamartDSLPackage.DATAMART_ENTITY__ORDERING: |
| return ordering != null && !ordering.isEmpty(); |
| case DatamartDSLPackage.DATAMART_ENTITY__SUPPRESS_ATTRIBUTES: |
| return suppressAttributes != SUPPRESS_ATTRIBUTES_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_ENTITY__FILLER_MIN_COUNT_ROWS: |
| return fillerMinCountRows != FILLER_MIN_COUNT_ROWS_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_ENTITY__FILLER_MAX_COUNT_ROWS: |
| return fillerMaxCountRows != FILLER_MAX_COUNT_ROWS_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_ENTITY__TRACKING: |
| return tracking != TRACKING_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(" (suppressAttributes: "); |
| result.append(suppressAttributes); |
| result.append(", fillerMinCountRows: "); |
| result.append(fillerMinCountRows); |
| result.append(", fillerMaxCountRows: "); |
| result.append(fillerMaxCountRows); |
| result.append(", tracking: "); |
| result.append(tracking); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DatamartEntityImpl |