/** | |
* Copyright (c) 2016 CEA LIST. | |
* | |
* 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 | |
* | |
* Contributors: | |
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr | |
* - Initial API and Implementation | |
*/ | |
package org.eclipse.efm.ecore.sew.expression.impl; | |
import org.eclipse.efm.ecore.sew.WObject; | |
import org.eclipse.efm.ecore.sew.expression.ExpressionPackage; | |
import org.eclipse.efm.ecore.sew.expression.LiteralObjectReference; | |
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; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Literal Object Reference</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.efm.ecore.sew.expression.impl.LiteralObjectReferenceImpl#getObject <em>Object</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class LiteralObjectReferenceImpl extends LiteralReferenceValueImpl implements LiteralObjectReference { | |
/** | |
* The cached value of the '{@link #getObject() <em>Object</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getObject() | |
* @generated | |
* @ordered | |
*/ | |
protected WObject object; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected LiteralObjectReferenceImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return ExpressionPackage.Literals.LITERAL_OBJECT_REFERENCE; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public WObject getObject() { | |
if (object != null && object.eIsProxy()) { | |
InternalEObject oldObject = (InternalEObject)object; | |
object = (WObject)eResolveProxy(oldObject); | |
if (object != oldObject) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExpressionPackage.LITERAL_OBJECT_REFERENCE__OBJECT, oldObject, object)); | |
} | |
} | |
return object; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public WObject basicGetObject() { | |
return object; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setObject(WObject newObject) { | |
WObject oldObject = object; | |
object = newObject; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, ExpressionPackage.LITERAL_OBJECT_REFERENCE__OBJECT, oldObject, object)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case ExpressionPackage.LITERAL_OBJECT_REFERENCE__OBJECT: | |
if (resolve) return getObject(); | |
return basicGetObject(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case ExpressionPackage.LITERAL_OBJECT_REFERENCE__OBJECT: | |
setObject((WObject)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case ExpressionPackage.LITERAL_OBJECT_REFERENCE__OBJECT: | |
setObject((WObject)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case ExpressionPackage.LITERAL_OBJECT_REFERENCE__OBJECT: | |
return object != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //LiteralObjectReferenceImpl |