blob: e6bfa341c19f56a1c48d65f6c86c2da1d0d2a548 [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
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*/
package org.eclipse.osbp.infogrid.model.gridsource.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.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.xtext.common.types.JvmOperation;
import org.eclipse.osbp.infogrid.model.gridsource.CxGridNestedPath;
import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourcePackage;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>Cx Grid Nested Path</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridNestedPathImpl#getField <em>Field</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridNestedPathImpl#getPath <em>Path</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridNestedPathImpl#getDotPath <em>Dot Path</em>}</li>
* </ul>
*
* @generated
*/
public class CxGridNestedPathImpl extends MinimalEObjectImpl.Container
implements CxGridNestedPath {
/**
* The cached value of the '{@link #getField() <em>Field</em>}' reference.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @see #getField()
* @generated
* @ordered
*/
protected JvmOperation field;
/**
* The cached value of the '{@link #getPath() <em>Path</em>}' containment reference.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @see #getPath()
* @generated
* @ordered
*/
protected CxGridNestedPath path;
/**
* The default value of the '{@link #getDotPath() <em>Dot Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDotPath()
* @generated
* @ordered
*/
protected static final String DOT_PATH_EDEFAULT = null;
/**
* The cached value of the '{@link #getDotPath() <em>Dot Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDotPath()
* @generated
* @ordered
*/
protected String dotPath = DOT_PATH_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
protected CxGridNestedPathImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CxGridSourcePackage.Literals.CX_GRID_NESTED_PATH;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public JvmOperation getField() {
if (field != null && field.eIsProxy()) {
InternalEObject oldField = (InternalEObject)field;
field = (JvmOperation)eResolveProxy(oldField);
if (field != oldField) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, CxGridSourcePackage.CX_GRID_NESTED_PATH__FIELD, oldField, field));
}
}
return field;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public JvmOperation basicGetField() {
return field;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setField(JvmOperation newField) {
JvmOperation oldField = field;
field = newField;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_NESTED_PATH__FIELD, oldField, field));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public CxGridNestedPath getPath() {
return path;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPath(CxGridNestedPath newPath,
NotificationChain msgs) {
CxGridNestedPath oldPath = path;
path = newPath;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_NESTED_PATH__PATH, oldPath, newPath);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setPath(CxGridNestedPath newPath) {
if (newPath != path) {
NotificationChain msgs = null;
if (path != null)
msgs = ((InternalEObject)path).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_NESTED_PATH__PATH, null, msgs);
if (newPath != null)
msgs = ((InternalEObject)newPath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_NESTED_PATH__PATH, null, msgs);
msgs = basicSetPath(newPath, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_NESTED_PATH__PATH, newPath, newPath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDotPath() {
return dotPath;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDotPath(String newDotPath) {
String oldDotPath = dotPath;
dotPath = newDotPath;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_NESTED_PATH__DOT_PATH, oldDotPath, dotPath));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_NESTED_PATH__PATH:
return basicSetPath(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 CxGridSourcePackage.CX_GRID_NESTED_PATH__FIELD:
if (resolve) return getField();
return basicGetField();
case CxGridSourcePackage.CX_GRID_NESTED_PATH__PATH:
return getPath();
case CxGridSourcePackage.CX_GRID_NESTED_PATH__DOT_PATH:
return getDotPath();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_NESTED_PATH__FIELD:
setField((JvmOperation)newValue);
return;
case CxGridSourcePackage.CX_GRID_NESTED_PATH__PATH:
setPath((CxGridNestedPath)newValue);
return;
case CxGridSourcePackage.CX_GRID_NESTED_PATH__DOT_PATH:
setDotPath((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_NESTED_PATH__FIELD:
setField((JvmOperation)null);
return;
case CxGridSourcePackage.CX_GRID_NESTED_PATH__PATH:
setPath((CxGridNestedPath)null);
return;
case CxGridSourcePackage.CX_GRID_NESTED_PATH__DOT_PATH:
setDotPath(DOT_PATH_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_NESTED_PATH__FIELD:
return field != null;
case CxGridSourcePackage.CX_GRID_NESTED_PATH__PATH:
return path != null;
case CxGridSourcePackage.CX_GRID_NESTED_PATH__DOT_PATH:
return DOT_PATH_EDEFAULT == null ? dotPath != null : !DOT_PATH_EDEFAULT.equals(dotPath);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (dotPath: ");
result.append(dotPath);
result.append(')');
return result.toString();
}
} // CxGridNestedPathImpl