| /**
|
| * *******************************************************************************
|
| * Copyright (c) 2009, 2019 Mia-Software and others.
|
| * All rights reserved. This program and the accompanying materials
|
| * are made available under the terms of the Eclipse Public License v2.0
|
| * which accompanies this distribution, and is available at
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| *
|
| * Fabien Giquel (Mia-Software) - initial API and implementation
|
| * Gregoire DUPE (Mia-Software) - initial API and implementation
|
| * *******************************************************************************
|
| *
|
| * $Id$
|
| */ |
| package org.eclipse.modisco.java.nousages.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.modisco.java.BreakStatement;
|
| import org.eclipse.modisco.java.LabeledStatement;
|
| import org.eclipse.modisco.java.nousages.meta.JavaPackage;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * An implementation of the model object '<em><b>Break Statement</b></em>'.
|
| * <!-- end-user-doc -->
|
| * <p>
|
| * The following features are implemented:
|
| * <ul>
|
| * <li>{@link org.eclipse.modisco.java.nousages.impl.BreakStatementImpl#getLabel <em>Label</em>}</li>
|
| * </ul>
|
| * </p>
|
| *
|
| * @generated
|
| */
|
| public class BreakStatementImpl extends StatementImpl implements BreakStatement {
|
| /**
|
| * The cached value of the '{@link #getLabel() <em>Label</em>}' reference.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getLabel()
|
| * @generated
|
| * @ordered
|
| */
|
| protected LabeledStatement label;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| protected BreakStatementImpl() {
|
| super();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| protected EClass eStaticClass() {
|
| return JavaPackage.eINSTANCE.getBreakStatement();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public LabeledStatement getLabel() {
|
| if (label != null && label.eIsProxy()) {
|
| InternalEObject oldLabel = (InternalEObject)label;
|
| label = (LabeledStatement)eResolveProxy(oldLabel);
|
| if (label != oldLabel) {
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.BREAK_STATEMENT__LABEL, oldLabel, label));
|
| }
|
| }
|
| return label;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public LabeledStatement basicGetLabel() {
|
| return label;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setLabel(LabeledStatement newLabel) {
|
| LabeledStatement oldLabel = label;
|
| label = newLabel;
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.BREAK_STATEMENT__LABEL, oldLabel, label));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
| switch (featureID) {
|
| case JavaPackage.BREAK_STATEMENT__LABEL:
|
| if (resolve) return getLabel();
|
| return basicGetLabel();
|
| }
|
| 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.BREAK_STATEMENT__LABEL:
|
| setLabel((LabeledStatement)newValue);
|
| return;
|
| }
|
| super.eSet(featureID, newValue);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eUnset(int featureID) {
|
| switch (featureID) {
|
| case JavaPackage.BREAK_STATEMENT__LABEL:
|
| setLabel((LabeledStatement)null);
|
| return;
|
| }
|
| super.eUnset(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public boolean eIsSet(int featureID) {
|
| switch (featureID) {
|
| case JavaPackage.BREAK_STATEMENT__LABEL:
|
| return label != null;
|
| }
|
| return super.eIsSet(featureID);
|
| }
|
|
|
| } //BreakStatementImpl
|