blob: 170697dd9634bcbe718858012dc36e6cfa1f304f [file] [log] [blame]
/**
* 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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* 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.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.datamartdsl.DatamartAttributeBase;
import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Datamart Attribute Base</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.DatamartAttributeBaseImpl#getAttributeRef <em>Attribute Ref</em>}</li>
* </ul>
*
* @generated
*/
public class DatamartAttributeBaseImpl extends ExpressionImpl implements DatamartAttributeBase {
/**
* The cached value of the '{@link #getAttributeRef() <em>Attribute Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttributeRef()
* @generated
* @ordered
*/
protected LEntityAttribute attributeRef;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DatamartAttributeBaseImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DatamartDSLPackage.Literals.DATAMART_ATTRIBUTE_BASE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LEntityAttribute getAttributeRef() {
if (attributeRef != null && attributeRef.eIsProxy()) {
InternalEObject oldAttributeRef = (InternalEObject)attributeRef;
attributeRef = (LEntityAttribute)eResolveProxy(oldAttributeRef);
if (attributeRef != oldAttributeRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DatamartDSLPackage.DATAMART_ATTRIBUTE_BASE__ATTRIBUTE_REF, oldAttributeRef, attributeRef));
}
}
return attributeRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LEntityAttribute basicGetAttributeRef() {
return attributeRef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAttributeRef(LEntityAttribute newAttributeRef) {
LEntityAttribute oldAttributeRef = attributeRef;
attributeRef = newAttributeRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.DATAMART_ATTRIBUTE_BASE__ATTRIBUTE_REF, oldAttributeRef, attributeRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DatamartDSLPackage.DATAMART_ATTRIBUTE_BASE__ATTRIBUTE_REF:
if (resolve) return getAttributeRef();
return basicGetAttributeRef();
}
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_ATTRIBUTE_BASE__ATTRIBUTE_REF:
setAttributeRef((LEntityAttribute)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DatamartDSLPackage.DATAMART_ATTRIBUTE_BASE__ATTRIBUTE_REF:
setAttributeRef((LEntityAttribute)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DatamartDSLPackage.DATAMART_ATTRIBUTE_BASE__ATTRIBUTE_REF:
return attributeRef != null;
}
return super.eIsSet(featureID);
}
} //DatamartAttributeBaseImpl