| /** |
| * Copyright (c) 2010, 2012 Obeo. |
| * 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: |
| * Obeo - initial API and implementation |
| */ |
| package org.eclipse.mylyn.docs.intent.bridge.java.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.EObjectImpl; |
| |
| import org.eclipse.mylyn.docs.intent.bridge.java.DocumentedElement; |
| import org.eclipse.mylyn.docs.intent.bridge.java.JavaPackage; |
| import org.eclipse.mylyn.docs.intent.bridge.java.Javadoc; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Documented Element</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.mylyn.docs.intent.bridge.java.impl.DocumentedElementImpl#getJavadoc <em>Javadoc</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class DocumentedElementImpl extends EObjectImpl implements DocumentedElement { |
| /** |
| * The cached value of the '{@link #getJavadoc() <em>Javadoc</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getJavadoc() |
| * @generated |
| * @ordered |
| */ |
| protected Javadoc javadoc; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DocumentedElementImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return JavaPackage.Literals.DOCUMENTED_ELEMENT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Javadoc getJavadoc() { |
| return javadoc; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetJavadoc(Javadoc newJavadoc, NotificationChain msgs) { |
| Javadoc oldJavadoc = javadoc; |
| javadoc = newJavadoc; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JavaPackage.DOCUMENTED_ELEMENT__JAVADOC, oldJavadoc, newJavadoc); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setJavadoc(Javadoc newJavadoc) { |
| if (newJavadoc != javadoc) { |
| NotificationChain msgs = null; |
| if (javadoc != null) |
| msgs = ((InternalEObject)javadoc).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JavaPackage.DOCUMENTED_ELEMENT__JAVADOC, null, msgs); |
| if (newJavadoc != null) |
| msgs = ((InternalEObject)newJavadoc).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JavaPackage.DOCUMENTED_ELEMENT__JAVADOC, null, msgs); |
| msgs = basicSetJavadoc(newJavadoc, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.DOCUMENTED_ELEMENT__JAVADOC, newJavadoc, newJavadoc)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case JavaPackage.DOCUMENTED_ELEMENT__JAVADOC: |
| return basicSetJavadoc(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 JavaPackage.DOCUMENTED_ELEMENT__JAVADOC: |
| return getJavadoc(); |
| } |
| 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.DOCUMENTED_ELEMENT__JAVADOC: |
| setJavadoc((Javadoc)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case JavaPackage.DOCUMENTED_ELEMENT__JAVADOC: |
| setJavadoc((Javadoc)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case JavaPackage.DOCUMENTED_ELEMENT__JAVADOC: |
| return javadoc != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DocumentedElementImpl |