All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.xtext.xbase.impl.XCatchClauseImpl Maven / Gradle / Ivy

/**
 * Copyright (c) 2011 itemis AG (http://www.itemis.eu) 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
 */
package org.eclipse.xtext.xbase.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.JvmFormalParameter;

import org.eclipse.xtext.xbase.XCatchClause;
import org.eclipse.xtext.xbase.XExpression;
import org.eclipse.xtext.xbase.XbasePackage;

/**
 * 
 * An implementation of the model object 'XCatch Clause'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.eclipse.xtext.xbase.impl.XCatchClauseImpl#getExpression Expression}
  • *
  • {@link org.eclipse.xtext.xbase.impl.XCatchClauseImpl#getDeclaredParam Declared Param}
  • *
* * @generated */ public class XCatchClauseImpl extends MinimalEObjectImpl.Container implements XCatchClause { /** * The cached value of the '{@link #getExpression() Expression}' containment reference. * * * @see #getExpression() * @generated * @ordered */ protected XExpression expression; /** * The cached value of the '{@link #getDeclaredParam() Declared Param}' containment reference. * * * @see #getDeclaredParam() * @generated * @ordered */ protected JvmFormalParameter declaredParam; /** * * * @generated */ protected XCatchClauseImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return XbasePackage.Literals.XCATCH_CLAUSE; } /** * * * @generated */ public XExpression getExpression() { return expression; } /** * * * @generated */ public NotificationChain basicSetExpression(XExpression newExpression, NotificationChain msgs) { XExpression oldExpression = expression; expression = newExpression; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XbasePackage.XCATCH_CLAUSE__EXPRESSION, oldExpression, newExpression); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setExpression(XExpression newExpression) { if (newExpression != expression) { NotificationChain msgs = null; if (expression != null) msgs = ((InternalEObject)expression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XCATCH_CLAUSE__EXPRESSION, null, msgs); if (newExpression != null) msgs = ((InternalEObject)newExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XCATCH_CLAUSE__EXPRESSION, null, msgs); msgs = basicSetExpression(newExpression, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XCATCH_CLAUSE__EXPRESSION, newExpression, newExpression)); } /** * * * @generated */ public JvmFormalParameter getDeclaredParam() { return declaredParam; } /** * * * @generated */ public NotificationChain basicSetDeclaredParam(JvmFormalParameter newDeclaredParam, NotificationChain msgs) { JvmFormalParameter oldDeclaredParam = declaredParam; declaredParam = newDeclaredParam; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XbasePackage.XCATCH_CLAUSE__DECLARED_PARAM, oldDeclaredParam, newDeclaredParam); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setDeclaredParam(JvmFormalParameter newDeclaredParam) { if (newDeclaredParam != declaredParam) { NotificationChain msgs = null; if (declaredParam != null) msgs = ((InternalEObject)declaredParam).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XCATCH_CLAUSE__DECLARED_PARAM, null, msgs); if (newDeclaredParam != null) msgs = ((InternalEObject)newDeclaredParam).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XCATCH_CLAUSE__DECLARED_PARAM, null, msgs); msgs = basicSetDeclaredParam(newDeclaredParam, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XCATCH_CLAUSE__DECLARED_PARAM, newDeclaredParam, newDeclaredParam)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case XbasePackage.XCATCH_CLAUSE__EXPRESSION: return basicSetExpression(null, msgs); case XbasePackage.XCATCH_CLAUSE__DECLARED_PARAM: return basicSetDeclaredParam(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XbasePackage.XCATCH_CLAUSE__EXPRESSION: return getExpression(); case XbasePackage.XCATCH_CLAUSE__DECLARED_PARAM: return getDeclaredParam(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case XbasePackage.XCATCH_CLAUSE__EXPRESSION: setExpression((XExpression)newValue); return; case XbasePackage.XCATCH_CLAUSE__DECLARED_PARAM: setDeclaredParam((JvmFormalParameter)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case XbasePackage.XCATCH_CLAUSE__EXPRESSION: setExpression((XExpression)null); return; case XbasePackage.XCATCH_CLAUSE__DECLARED_PARAM: setDeclaredParam((JvmFormalParameter)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case XbasePackage.XCATCH_CLAUSE__EXPRESSION: return expression != null; case XbasePackage.XCATCH_CLAUSE__DECLARED_PARAM: return declaredParam != null; } return super.eIsSet(featureID); } } //XCatchClauseImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy