/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.eclipse.acceleo.tutorial.webapp.impl;
import org.eclipse.acceleo.tutorial.webapp.Collection;
import org.eclipse.acceleo.tutorial.webapp.Model;
import org.eclipse.acceleo.tutorial.webapp.ModelView;
import org.eclipse.acceleo.tutorial.webapp.WebappPackage;
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>Model View</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.acceleo.tutorial.webapp.impl.ModelViewImpl#getCollection <em>Collection</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ModelViewImpl extends AbstractViewImpl implements ModelView {
/**
* The cached value of the '{@link #getCollection() <em>Collection</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCollection()
* @generated
* @ordered
*/
protected Collection collection;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModelViewImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return WebappPackage.Literals.MODEL_VIEW;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Collection getCollection() {
if (collection != null && collection.eIsProxy()) {
InternalEObject oldCollection = (InternalEObject)collection;
collection = (Collection)eResolveProxy(oldCollection);
if (collection != oldCollection) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WebappPackage.MODEL_VIEW__COLLECTION, oldCollection, collection));
}
}
return collection;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Collection basicGetCollection() {
return collection;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCollection(Collection newCollection) {
Collection oldCollection = collection;
collection = newCollection;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WebappPackage.MODEL_VIEW__COLLECTION, oldCollection, collection));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case WebappPackage.MODEL_VIEW__COLLECTION:
if (resolve) return getCollection();
return basicGetCollection();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case WebappPackage.MODEL_VIEW__COLLECTION:
setCollection((Collection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case WebappPackage.MODEL_VIEW__COLLECTION:
setCollection((Collection)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case WebappPackage.MODEL_VIEW__COLLECTION:
return collection != null;
}
return super.eIsSet(featureID);
}
} //ModelViewImpl