| /** |
| * |
| * 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.CxGridNestedField; |
| 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 Field</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridNestedFieldImpl#getField <em>Field</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridNestedFieldImpl#getPath <em>Path</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridNestedFieldImpl#getDotPath <em>Dot Path</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CxGridNestedFieldImpl extends MinimalEObjectImpl.Container implements CxGridNestedField { |
| /** |
| * 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 CxGridNestedFieldImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CxGridSourcePackage.Literals.CX_GRID_NESTED_FIELD; |
| } |
| |
| /** |
| * <!-- 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_FIELD__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_FIELD__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_FIELD__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_FIELD__PATH, null, msgs); |
| if (newPath != null) |
| msgs = ((InternalEObject)newPath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_NESTED_FIELD__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_FIELD__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_FIELD__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_FIELD__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_FIELD__FIELD: |
| if (resolve) return getField(); |
| return basicGetField(); |
| case CxGridSourcePackage.CX_GRID_NESTED_FIELD__PATH: |
| return getPath(); |
| case CxGridSourcePackage.CX_GRID_NESTED_FIELD__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_FIELD__FIELD: |
| setField((JvmOperation)newValue); |
| return; |
| case CxGridSourcePackage.CX_GRID_NESTED_FIELD__PATH: |
| setPath((CxGridNestedPath)newValue); |
| return; |
| case CxGridSourcePackage.CX_GRID_NESTED_FIELD__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_FIELD__FIELD: |
| setField((JvmOperation)null); |
| return; |
| case CxGridSourcePackage.CX_GRID_NESTED_FIELD__PATH: |
| setPath((CxGridNestedPath)null); |
| return; |
| case CxGridSourcePackage.CX_GRID_NESTED_FIELD__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_FIELD__FIELD: |
| return field != null; |
| case CxGridSourcePackage.CX_GRID_NESTED_FIELD__PATH: |
| return path != null; |
| case CxGridSourcePackage.CX_GRID_NESTED_FIELD__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(); |
| } |
| |
| } //CxGridNestedFieldImpl |