| /** |
| * 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 org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartDefinition; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartSource; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Datamart Definition</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartDefinitionImpl#isDescription <em>Description</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartDefinitionImpl#getDescriptionValue <em>Description Value</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartDefinitionImpl#isShowCaption <em>Show Caption</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartDefinitionImpl#getNumMultiRows <em>Num Multi Rows</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartDefinitionImpl#getSource <em>Source</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DatamartDefinitionImpl extends DatamartBaseImpl implements DatamartDefinition { |
| /** |
| * The default value of the '{@link #isDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isDescription() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean DESCRIPTION_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isDescription() |
| * @generated |
| * @ordered |
| */ |
| protected boolean description = DESCRIPTION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getDescriptionValue() <em>Description Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescriptionValue() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DESCRIPTION_VALUE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getDescriptionValue() <em>Description Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescriptionValue() |
| * @generated |
| * @ordered |
| */ |
| protected String descriptionValue = DESCRIPTION_VALUE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isShowCaption() <em>Show Caption</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isShowCaption() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean SHOW_CAPTION_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isShowCaption() <em>Show Caption</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isShowCaption() |
| * @generated |
| * @ordered |
| */ |
| protected boolean showCaption = SHOW_CAPTION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getNumMultiRows() <em>Num Multi Rows</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNumMultiRows() |
| * @generated |
| * @ordered |
| */ |
| protected static final int NUM_MULTI_ROWS_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getNumMultiRows() <em>Num Multi Rows</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNumMultiRows() |
| * @generated |
| * @ordered |
| */ |
| protected int numMultiRows = NUM_MULTI_ROWS_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getSource() <em>Source</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSource() |
| * @generated |
| * @ordered |
| */ |
| protected DatamartSource source; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DatamartDefinitionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DatamartDSLPackage.Literals.DATAMART_DEFINITION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescription(boolean newDescription) { |
| boolean oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_DEFINITION__DESCRIPTION, oldDescription, description)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getDescriptionValue() { |
| return descriptionValue; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescriptionValue(String newDescriptionValue) { |
| String oldDescriptionValue = descriptionValue; |
| descriptionValue = newDescriptionValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_DEFINITION__DESCRIPTION_VALUE, oldDescriptionValue, descriptionValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isShowCaption() { |
| return showCaption; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setShowCaption(boolean newShowCaption) { |
| boolean oldShowCaption = showCaption; |
| showCaption = newShowCaption; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_DEFINITION__SHOW_CAPTION, oldShowCaption, showCaption)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getNumMultiRows() { |
| return numMultiRows; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setNumMultiRows(int newNumMultiRows) { |
| int oldNumMultiRows = numMultiRows; |
| numMultiRows = newNumMultiRows; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_DEFINITION__NUM_MULTI_ROWS, oldNumMultiRows, numMultiRows)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DatamartSource getSource() { |
| return source; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetSource(DatamartSource newSource, NotificationChain msgs) { |
| DatamartSource oldSource = source; |
| source = newSource; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_DEFINITION__SOURCE, oldSource, newSource); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSource(DatamartSource newSource) { |
| if (newSource != source) { |
| NotificationChain msgs = null; |
| if (source != null) |
| msgs = ((InternalEObject)source).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DatamartDSLPackage.DATAMART_DEFINITION__SOURCE, null, msgs); |
| if (newSource != null) |
| msgs = ((InternalEObject)newSource).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DatamartDSLPackage.DATAMART_DEFINITION__SOURCE, null, msgs); |
| msgs = basicSetSource(newSource, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_DEFINITION__SOURCE, newSource, newSource)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_DEFINITION__SOURCE: |
| return basicSetSource(null, 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_DEFINITION__DESCRIPTION: |
| return isDescription(); |
| case DatamartDSLPackage.DATAMART_DEFINITION__DESCRIPTION_VALUE: |
| return getDescriptionValue(); |
| case DatamartDSLPackage.DATAMART_DEFINITION__SHOW_CAPTION: |
| return isShowCaption(); |
| case DatamartDSLPackage.DATAMART_DEFINITION__NUM_MULTI_ROWS: |
| return getNumMultiRows(); |
| case DatamartDSLPackage.DATAMART_DEFINITION__SOURCE: |
| return getSource(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_DEFINITION__DESCRIPTION: |
| setDescription((Boolean)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_DEFINITION__DESCRIPTION_VALUE: |
| setDescriptionValue((String)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_DEFINITION__SHOW_CAPTION: |
| setShowCaption((Boolean)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_DEFINITION__NUM_MULTI_ROWS: |
| setNumMultiRows((Integer)newValue); |
| return; |
| case DatamartDSLPackage.DATAMART_DEFINITION__SOURCE: |
| setSource((DatamartSource)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_DEFINITION__DESCRIPTION: |
| setDescription(DESCRIPTION_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_DEFINITION__DESCRIPTION_VALUE: |
| setDescriptionValue(DESCRIPTION_VALUE_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_DEFINITION__SHOW_CAPTION: |
| setShowCaption(SHOW_CAPTION_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_DEFINITION__NUM_MULTI_ROWS: |
| setNumMultiRows(NUM_MULTI_ROWS_EDEFAULT); |
| return; |
| case DatamartDSLPackage.DATAMART_DEFINITION__SOURCE: |
| setSource((DatamartSource)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DatamartDSLPackage.DATAMART_DEFINITION__DESCRIPTION: |
| return description != DESCRIPTION_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_DEFINITION__DESCRIPTION_VALUE: |
| return DESCRIPTION_VALUE_EDEFAULT == null ? descriptionValue != null : !DESCRIPTION_VALUE_EDEFAULT.equals(descriptionValue); |
| case DatamartDSLPackage.DATAMART_DEFINITION__SHOW_CAPTION: |
| return showCaption != SHOW_CAPTION_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_DEFINITION__NUM_MULTI_ROWS: |
| return numMultiRows != NUM_MULTI_ROWS_EDEFAULT; |
| case DatamartDSLPackage.DATAMART_DEFINITION__SOURCE: |
| return source != 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(" (description: "); |
| result.append(description); |
| result.append(", descriptionValue: "); |
| result.append(descriptionValue); |
| result.append(", showCaption: "); |
| result.append(showCaption); |
| result.append(", numMultiRows: "); |
| result.append(numMultiRows); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DatamartDefinitionImpl |