| /** |
| * 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 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.osbp.dsl.semantic.entity.LEntityAttribute; |
| |
| import org.eclipse.osbp.xtext.datainterchange.DataDSLPackage; |
| import org.eclipse.osbp.xtext.datainterchange.DataInterchangeValueMapping; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Data Interchange Value Mapping</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeValueMappingImpl#getProperty <em>Property</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeValueMappingImpl#getData <em>Data</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DataInterchangeValueMappingImpl extends DataInterchangeLazyResolverImpl implements DataInterchangeValueMapping { |
| /** |
| * The cached value of the '{@link #getProperty() <em>Property</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProperty() |
| * @generated |
| * @ordered |
| */ |
| protected LEntityAttribute property; |
| |
| /** |
| * The default value of the '{@link #getData() <em>Data</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getData() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DATA_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getData() <em>Data</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getData() |
| * @generated |
| * @ordered |
| */ |
| protected String data = DATA_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DataInterchangeValueMappingImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DataDSLPackage.Literals.DATA_INTERCHANGE_VALUE_MAPPING; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntityAttribute getProperty() { |
| if (property != null && property.eIsProxy()) { |
| InternalEObject oldProperty = (InternalEObject)property; |
| property = (LEntityAttribute)eResolveProxy(oldProperty); |
| if (property != oldProperty) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__PROPERTY, oldProperty, property)); |
| } |
| } |
| return property; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LEntityAttribute basicGetProperty() { |
| return property; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setProperty(LEntityAttribute newProperty) { |
| LEntityAttribute oldProperty = property; |
| property = newProperty; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__PROPERTY, oldProperty, property)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getData() { |
| return data; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setData(String newData) { |
| String oldData = data; |
| data = newData; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__DATA, oldData, data)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__PROPERTY: |
| if (resolve) return getProperty(); |
| return basicGetProperty(); |
| case DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__DATA: |
| return getData(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__PROPERTY: |
| setProperty((LEntityAttribute)newValue); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__DATA: |
| setData((String)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_VALUE_MAPPING__PROPERTY: |
| setProperty((LEntityAttribute)null); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__DATA: |
| setData(DATA_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__PROPERTY: |
| return property != null; |
| case DataDSLPackage.DATA_INTERCHANGE_VALUE_MAPPING__DATA: |
| return DATA_EDEFAULT == null ? data != null : !DATA_EDEFAULT.equals(data); |
| } |
| 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(" (data: "); |
| result.append(data); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DataInterchangeValueMappingImpl |