blob: afc2a3fc095ecb9be793d56e88be519949e6b6f3 [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.dsl.semantic.entity.LEntityReference;
import org.eclipse.osbp.xtext.entitymock.EntityMockDSLPackage;
import org.eclipse.osbp.xtext.entitymock.EntityMockEntityNestedAttribute;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Entity Mock Entity Nested Attribute</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockEntityNestedAttributeImpl#getReference <em>Reference</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockEntityNestedAttributeImpl#getAttribute <em>Attribute</em>}</li>
* </ul>
*
* @generated
*/
public class EntityMockEntityNestedAttributeImpl extends MinimalEObjectImpl.Container implements EntityMockEntityNestedAttribute {
/**
* The cached value of the '{@link #getReference() <em>Reference</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReference()
* @generated
* @ordered
*/
protected LEntityReference reference;
/**
* The cached value of the '{@link #getAttribute() <em>Attribute</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttribute()
* @generated
* @ordered
*/
protected LEntityAttribute attribute;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EntityMockEntityNestedAttributeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EntityMockDSLPackage.Literals.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LEntityReference getReference() {
if (reference != null && reference.eIsProxy()) {
InternalEObject oldReference = (InternalEObject)reference;
reference = (LEntityReference)eResolveProxy(oldReference);
if (reference != oldReference) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__REFERENCE, oldReference, reference));
}
}
return reference;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LEntityReference basicGetReference() {
return reference;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setReference(LEntityReference newReference) {
LEntityReference oldReference = reference;
reference = newReference;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__REFERENCE, oldReference, reference));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LEntityAttribute getAttribute() {
if (attribute != null && attribute.eIsProxy()) {
InternalEObject oldAttribute = (InternalEObject)attribute;
attribute = (LEntityAttribute)eResolveProxy(oldAttribute);
if (attribute != oldAttribute) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__ATTRIBUTE, oldAttribute, attribute));
}
}
return attribute;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LEntityAttribute basicGetAttribute() {
return attribute;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAttribute(LEntityAttribute newAttribute) {
LEntityAttribute oldAttribute = attribute;
attribute = newAttribute;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__ATTRIBUTE, oldAttribute, attribute));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__REFERENCE:
if (resolve) return getReference();
return basicGetReference();
case EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__ATTRIBUTE:
if (resolve) return getAttribute();
return basicGetAttribute();
}
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_ENTITY_NESTED_ATTRIBUTE__REFERENCE:
setReference((LEntityReference)newValue);
return;
case EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__ATTRIBUTE:
setAttribute((LEntityAttribute)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_ENTITY_NESTED_ATTRIBUTE__REFERENCE:
setReference((LEntityReference)null);
return;
case EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__ATTRIBUTE:
setAttribute((LEntityAttribute)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__REFERENCE:
return reference != null;
case EntityMockDSLPackage.ENTITY_MOCK_ENTITY_NESTED_ATTRIBUTE__ATTRIBUTE:
return attribute != null;
}
return super.eIsSet(featureID);
}
} //EntityMockEntityNestedAttributeImpl