| /** |
| * Copyright (c) 2019 CEA LIST. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation |
| */ |
| package org.eclipse.papyrus.model2doc.core.builtintypes.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.papyrus.model2doc.core.builtintypes.BuiltInTypesPackage; |
| import org.eclipse.papyrus.model2doc.core.builtintypes.DefaultFileReference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Default File Reference</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.model2doc.core.builtintypes.impl.DefaultFileReferenceImpl#getFilePath <em>File Path</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DefaultFileReferenceImpl extends MinimalEObjectImpl.Container implements DefaultFileReference { |
| /** |
| * The default value of the '{@link #getFilePath() <em>File Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getFilePath() |
| * @generated |
| * @ordered |
| */ |
| protected static final String FILE_PATH_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getFilePath() <em>File Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getFilePath() |
| * @generated |
| * @ordered |
| */ |
| protected String filePath = FILE_PATH_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected DefaultFileReferenceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BuiltInTypesPackage.Literals.DEFAULT_FILE_REFERENCE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String getFilePath() { |
| return filePath; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void setFilePath(String newFilePath) { |
| String oldFilePath = filePath; |
| filePath = newFilePath; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, BuiltInTypesPackage.DEFAULT_FILE_REFERENCE__FILE_PATH, oldFilePath, filePath)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case BuiltInTypesPackage.DEFAULT_FILE_REFERENCE__FILE_PATH: |
| return getFilePath(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case BuiltInTypesPackage.DEFAULT_FILE_REFERENCE__FILE_PATH: |
| setFilePath((String) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BuiltInTypesPackage.DEFAULT_FILE_REFERENCE__FILE_PATH: |
| setFilePath(FILE_PATH_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BuiltInTypesPackage.DEFAULT_FILE_REFERENCE__FILE_PATH: |
| return FILE_PATH_EDEFAULT == null ? filePath != null : !FILE_PATH_EDEFAULT.equals(filePath); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) { |
| return super.toString(); |
| } |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (filePath: "); //$NON-NLS-1$ |
| result.append(filePath); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // DefaultFileReferenceImpl |