/** * <copyright> * </copyright> * * $Id$ */ package com.emf4sw.owl.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import com.emf4sw.owl.Annotation; import com.emf4sw.owl.AnnotationProperty; import com.emf4sw.owl.OWLPackage; import com.emf4sw.rdf.Literal; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Annotation</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link com.emf4sw.owl.impl.AnnotationImpl#getProperty <em>Property</em>}</li> * <li>{@link com.emf4sw.owl.impl.AnnotationImpl#getValue <em>Value</em>}</li> * </ul> * </p> * * @generated */ public class AnnotationImpl extends AnnotatedElementImpl implements Annotation { /** * The cached value of the '{@link #getProperty() <em>Property</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperty() * @generated * @ordered */ protected AnnotationProperty property; /** * The cached value of the '{@link #getValue() <em>Value</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected Literal value; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected AnnotationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return OWLPackage.Literals.ANNOTATION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public AnnotationProperty getProperty() { if (property != null && property.eIsProxy()) { InternalEObject oldProperty = (InternalEObject)property; property = (AnnotationProperty)eResolveProxy(oldProperty); if (property != oldProperty) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, OWLPackage.ANNOTATION__PROPERTY, oldProperty, property)); } } return property; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public AnnotationProperty basicGetProperty() { return property; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setProperty(AnnotationProperty newProperty) { AnnotationProperty oldProperty = property; property = newProperty; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OWLPackage.ANNOTATION__PROPERTY, oldProperty, property)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Literal getValue() { if (value != null && value.eIsProxy()) { InternalEObject oldValue = (InternalEObject)value; value = (Literal)eResolveProxy(oldValue); if (value != oldValue) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, OWLPackage.ANNOTATION__VALUE, oldValue, value)); } } return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Literal basicGetValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setValue(Literal newValue) { Literal oldValue = value; value = newValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OWLPackage.ANNOTATION__VALUE, oldValue, value)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case OWLPackage.ANNOTATION__PROPERTY: if (resolve) return getProperty(); return basicGetProperty(); case OWLPackage.ANNOTATION__VALUE: if (resolve) return getValue(); return basicGetValue(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case OWLPackage.ANNOTATION__PROPERTY: setProperty((AnnotationProperty)newValue); return; case OWLPackage.ANNOTATION__VALUE: setValue((Literal)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case OWLPackage.ANNOTATION__PROPERTY: setProperty((AnnotationProperty)null); return; case OWLPackage.ANNOTATION__VALUE: setValue((Literal)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case OWLPackage.ANNOTATION__PROPERTY: return property != null; case OWLPackage.ANNOTATION__VALUE: return value != null; } return super.eIsSet(featureID); } } //AnnotationImpl