blob: ec4b948cc92e99b151350728f74abc3d503e7ccb [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.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.dsl.semantic.entity.LEntityAttribute;
import org.eclipse.osbp.xtext.datamartdsl.AttributeFillerData;
import org.eclipse.osbp.xtext.datamartdsl.AttributeFillerType;
import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Attribute Filler Data</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.AttributeFillerDataImpl#getAttributeRef <em>Attribute Ref</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.datamartdsl.impl.AttributeFillerDataImpl#getFillerType <em>Filler Type</em>}</li>
* </ul>
*
* @generated
*/
public class AttributeFillerDataImpl extends DatamartLazyResolverImpl implements AttributeFillerData {
/**
* 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;
/**
* The cached value of the '{@link #getFillerType() <em>Filler Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFillerType()
* @generated
* @ordered
*/
protected AttributeFillerType fillerType;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AttributeFillerDataImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DatamartDSLPackage.Literals.ATTRIBUTE_FILLER_DATA;
}
/**
* <!-- 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.ATTRIBUTE_FILLER_DATA__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.ATTRIBUTE_FILLER_DATA__ATTRIBUTE_REF, oldAttributeRef, attributeRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AttributeFillerType getFillerType() {
return fillerType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetFillerType(AttributeFillerType newFillerType, NotificationChain msgs) {
AttributeFillerType oldFillerType = fillerType;
fillerType = newFillerType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__FILLER_TYPE, oldFillerType, newFillerType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFillerType(AttributeFillerType newFillerType) {
if (newFillerType != fillerType) {
NotificationChain msgs = null;
if (fillerType != null)
msgs = ((InternalEObject)fillerType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__FILLER_TYPE, null, msgs);
if (newFillerType != null)
msgs = ((InternalEObject)newFillerType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__FILLER_TYPE, null, msgs);
msgs = basicSetFillerType(newFillerType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__FILLER_TYPE, newFillerType, newFillerType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__FILLER_TYPE:
return basicSetFillerType(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.ATTRIBUTE_FILLER_DATA__ATTRIBUTE_REF:
if (resolve) return getAttributeRef();
return basicGetAttributeRef();
case DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__FILLER_TYPE:
return getFillerType();
}
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.ATTRIBUTE_FILLER_DATA__ATTRIBUTE_REF:
setAttributeRef((LEntityAttribute)newValue);
return;
case DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__FILLER_TYPE:
setFillerType((AttributeFillerType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__ATTRIBUTE_REF:
setAttributeRef((LEntityAttribute)null);
return;
case DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__FILLER_TYPE:
setFillerType((AttributeFillerType)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__ATTRIBUTE_REF:
return attributeRef != null;
case DatamartDSLPackage.ATTRIBUTE_FILLER_DATA__FILLER_TYPE:
return fillerType != null;
}
return super.eIsSet(featureID);
}
} //AttributeFillerDataImpl