blob: 646dec933216ee062ce79b6fd6d5fc30cc6bd17c [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:
* Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation
*
*/
package org.eclipse.osbp.xtext.entitymock.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.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.osbp.dsl.semantic.entity.LEntityAttribute;
import org.eclipse.osbp.xtext.entitymock.EntityMockByResourceAttribute;
import org.eclipse.osbp.xtext.entitymock.EntityMockDSLPackage;
import org.eclipse.osbp.xtext.entitymock.EntityMockResourceAttribute;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Entity Mock By Resource Attribute</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockByResourceAttributeImpl#getAttributeRef <em>Attribute Ref</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockByResourceAttributeImpl#getResourceAttribute <em>Resource Attribute</em>}</li>
* </ul>
*
* @generated
*/
public class EntityMockByResourceAttributeImpl extends MinimalEObjectImpl.Container implements EntityMockByResourceAttribute {
/**
* 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 #getResourceAttribute() <em>Resource Attribute</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResourceAttribute()
* @generated
* @ordered
*/
protected EntityMockResourceAttribute resourceAttribute;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EntityMockByResourceAttributeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EntityMockDSLPackage.Literals.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE;
}
/**
* <!-- 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, EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__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, EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__ATTRIBUTE_REF, oldAttributeRef, attributeRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EntityMockResourceAttribute getResourceAttribute() {
if (resourceAttribute != null && resourceAttribute.eIsProxy()) {
InternalEObject oldResourceAttribute = (InternalEObject)resourceAttribute;
resourceAttribute = (EntityMockResourceAttribute)eResolveProxy(oldResourceAttribute);
if (resourceAttribute != oldResourceAttribute) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__RESOURCE_ATTRIBUTE, oldResourceAttribute, resourceAttribute));
}
}
return resourceAttribute;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EntityMockResourceAttribute basicGetResourceAttribute() {
return resourceAttribute;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setResourceAttribute(EntityMockResourceAttribute newResourceAttribute) {
EntityMockResourceAttribute oldResourceAttribute = resourceAttribute;
resourceAttribute = newResourceAttribute;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__RESOURCE_ATTRIBUTE, oldResourceAttribute, resourceAttribute));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__ATTRIBUTE_REF:
if (resolve) return getAttributeRef();
return basicGetAttributeRef();
case EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__RESOURCE_ATTRIBUTE:
if (resolve) return getResourceAttribute();
return basicGetResourceAttribute();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__ATTRIBUTE_REF:
setAttributeRef((LEntityAttribute)newValue);
return;
case EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__RESOURCE_ATTRIBUTE:
setResourceAttribute((EntityMockResourceAttribute)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__ATTRIBUTE_REF:
setAttributeRef((LEntityAttribute)null);
return;
case EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__RESOURCE_ATTRIBUTE:
setResourceAttribute((EntityMockResourceAttribute)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__ATTRIBUTE_REF:
return attributeRef != null;
case EntityMockDSLPackage.ENTITY_MOCK_BY_RESOURCE_ATTRIBUTE__RESOURCE_ATTRIBUTE:
return resourceAttribute != null;
}
return super.eIsSet(featureID);
}
} //EntityMockByResourceAttributeImpl