| /** |
| * Copyright (c) 2014, Loetz GmbH&Co.KG (Heidelberg) |
| * 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.datainterchange.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.xtext.datainterchange.DataDSLPackage; |
| import org.eclipse.osbp.xtext.datainterchange.DataInterchangeExportFilter; |
| import org.eclipse.osbp.xtext.datainterchange.DataInterchangeExportHide; |
| import org.eclipse.osbp.xtext.datainterchange.DataInterchangeFilterCondition; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Data Interchange Export Filter</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeExportFilterImpl#getCondition <em>Condition</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeExportFilterImpl#getHiddenproperties <em>Hiddenproperties</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DataInterchangeExportFilterImpl extends DataInterchangeLazyResolverImpl implements DataInterchangeExportFilter { |
| /** |
| * The cached value of the '{@link #getCondition() <em>Condition</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCondition() |
| * @generated |
| * @ordered |
| */ |
| protected DataInterchangeFilterCondition condition; |
| |
| /** |
| * The cached value of the '{@link #getHiddenproperties() <em>Hiddenproperties</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getHiddenproperties() |
| * @generated |
| * @ordered |
| */ |
| protected EList<DataInterchangeExportHide> hiddenproperties; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DataInterchangeExportFilterImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DataDSLPackage.Literals.DATA_INTERCHANGE_EXPORT_FILTER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DataInterchangeFilterCondition getCondition() { |
| return condition; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCondition(DataInterchangeFilterCondition newCondition, NotificationChain msgs) { |
| DataInterchangeFilterCondition oldCondition = condition; |
| condition = newCondition; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__CONDITION, oldCondition, newCondition); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCondition(DataInterchangeFilterCondition newCondition) { |
| if (newCondition != condition) { |
| NotificationChain msgs = null; |
| if (condition != null) |
| msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__CONDITION, null, msgs); |
| if (newCondition != null) |
| msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__CONDITION, null, msgs); |
| msgs = basicSetCondition(newCondition, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__CONDITION, newCondition, newCondition)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<DataInterchangeExportHide> getHiddenproperties() { |
| if (hiddenproperties == null) { |
| hiddenproperties = new EObjectContainmentEList<DataInterchangeExportHide>(DataInterchangeExportHide.class, this, DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__HIDDENPROPERTIES); |
| } |
| return hiddenproperties; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__CONDITION: |
| return basicSetCondition(null, msgs); |
| case DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__HIDDENPROPERTIES: |
| return ((InternalEList<?>)getHiddenproperties()).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 DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__CONDITION: |
| return getCondition(); |
| case DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__HIDDENPROPERTIES: |
| return getHiddenproperties(); |
| } |
| 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 DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__CONDITION: |
| setCondition((DataInterchangeFilterCondition)newValue); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__HIDDENPROPERTIES: |
| getHiddenproperties().clear(); |
| getHiddenproperties().addAll((Collection<? extends DataInterchangeExportHide>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__CONDITION: |
| setCondition((DataInterchangeFilterCondition)null); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__HIDDENPROPERTIES: |
| getHiddenproperties().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__CONDITION: |
| return condition != null; |
| case DataDSLPackage.DATA_INTERCHANGE_EXPORT_FILTER__HIDDENPROPERTIES: |
| return hiddenproperties != null && !hiddenproperties.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DataInterchangeExportFilterImpl |