| /******************************************************************************* |
| * Copyright (c) 2006, 2016 CEA LIST and others. |
| * 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: |
| * CEA LIST - initial API and implementation |
| * |
| * |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.papyrus.designer.languages.java.profile.java.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.papyrus.designer.languages.java.profile.java.JavaGen; |
| import org.eclipse.papyrus.designer.languages.java.profile.java.JavaPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Gen</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.designer.languages.java.profile.java.impl.JavaGenImpl#getSrcName <em>Src Name</em>}</li> |
| * <li>{@link org.eclipse.papyrus.designer.languages.java.profile.java.impl.JavaGenImpl#getProjectName <em>Project Name</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class JavaGenImpl extends JavaNamedElementImpl implements JavaGen { |
| /** |
| * The default value of the '{@link #getSrcName() <em>Src Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSrcName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String SRC_NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getSrcName() <em>Src Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSrcName() |
| * @generated |
| * @ordered |
| */ |
| protected String srcName = SRC_NAME_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getProjectName() <em>Project Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProjectName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String PROJECT_NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getProjectName() <em>Project Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProjectName() |
| * @generated |
| * @ordered |
| */ |
| protected String projectName = PROJECT_NAME_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected JavaGenImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return JavaPackage.Literals.JAVA_GEN; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getSrcName() { |
| return srcName; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSrcName(String newSrcName) { |
| String oldSrcName = srcName; |
| srcName = newSrcName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_GEN__SRC_NAME, oldSrcName, srcName)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getProjectName() { |
| return projectName; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setProjectName(String newProjectName) { |
| String oldProjectName = projectName; |
| projectName = newProjectName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_GEN__PROJECT_NAME, oldProjectName, projectName)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case JavaPackage.JAVA_GEN__SRC_NAME: |
| return getSrcName(); |
| case JavaPackage.JAVA_GEN__PROJECT_NAME: |
| return getProjectName(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case JavaPackage.JAVA_GEN__SRC_NAME: |
| setSrcName((String)newValue); |
| return; |
| case JavaPackage.JAVA_GEN__PROJECT_NAME: |
| setProjectName((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case JavaPackage.JAVA_GEN__SRC_NAME: |
| setSrcName(SRC_NAME_EDEFAULT); |
| return; |
| case JavaPackage.JAVA_GEN__PROJECT_NAME: |
| setProjectName(PROJECT_NAME_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case JavaPackage.JAVA_GEN__SRC_NAME: |
| return SRC_NAME_EDEFAULT == null ? srcName != null : !SRC_NAME_EDEFAULT.equals(srcName); |
| case JavaPackage.JAVA_GEN__PROJECT_NAME: |
| return PROJECT_NAME_EDEFAULT == null ? projectName != null : !PROJECT_NAME_EDEFAULT.equals(projectName); |
| } |
| 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(" (srcName: "); |
| result.append(srcName); |
| result.append(", projectName: "); |
| result.append(projectName); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //JavaGenImpl |