blob: c19d3e5510080b34d3b685a48b00213985d9bcae [file] [log] [blame]
/**
* 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.DataInterchangeKey;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Data Interchange Key</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeKeyImpl#getProperty <em>Property</em>}</li>
* </ul>
*
* @generated
*/
public class DataInterchangeKeyImpl extends DataInterchangeLazyResolverImpl implements DataInterchangeKey {
/**
* The cached value of the '{@link #getProperty() <em>Property</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProperty()
* @generated
* @ordered
*/
protected LEntityAttribute property;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DataInterchangeKeyImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DataDSLPackage.Literals.DATA_INTERCHANGE_KEY;
}
/**
* <!-- 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_KEY__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_KEY__PROPERTY, oldProperty, property));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DataDSLPackage.DATA_INTERCHANGE_KEY__PROPERTY:
if (resolve) return getProperty();
return basicGetProperty();
}
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_KEY__PROPERTY:
setProperty((LEntityAttribute)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_KEY__PROPERTY:
setProperty((LEntityAttribute)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DataDSLPackage.DATA_INTERCHANGE_KEY__PROPERTY:
return property != null;
}
return super.eIsSet(featureID);
}
} //DataInterchangeKeyImpl