/** */ package org.w3.xlink.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; 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.emf.ecore.util.BasicFeatureMap; import org.eclipse.emf.ecore.util.FeatureMap; import org.eclipse.emf.ecore.util.InternalEList; import org.w3.xlink.ResourceType; import org.w3.xlink.TypeType; import org.w3.xlink.XlinkPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Resource Type</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.w3.xlink.impl.ResourceTypeImpl#getLabel <em>Label</em>}</li> * <li>{@link org.w3.xlink.impl.ResourceTypeImpl#getRole <em>Role</em>}</li> * <li>{@link org.w3.xlink.impl.ResourceTypeImpl#getTitle <em>Title</em>}</li> * <li>{@link org.w3.xlink.impl.ResourceTypeImpl#getType <em>Type</em>}</li> * <li>{@link org.w3.xlink.impl.ResourceTypeImpl#getContents <em>Contents</em>}</li> * </ul> * </p> * * @generated */ public class ResourceTypeImpl extends EObjectImpl implements ResourceType { /** * The default value of the '{@link #getLabel() <em>Label</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLabel() * @generated * @ordered */ protected static final String LABEL_EDEFAULT = null; /** * The cached value of the '{@link #getLabel() <em>Label</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLabel() * @generated * @ordered */ protected String label = LABEL_EDEFAULT; /** * The default value of the '{@link #getRole() <em>Role</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRole() * @generated * @ordered */ protected static final String ROLE_EDEFAULT = null; /** * The cached value of the '{@link #getRole() <em>Role</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRole() * @generated * @ordered */ protected String role = ROLE_EDEFAULT; /** * The default value of the '{@link #getTitle() <em>Title</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getTitle() * @generated * @ordered */ protected static final String TITLE_EDEFAULT = null; /** * The cached value of the '{@link #getTitle() <em>Title</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getTitle() * @generated * @ordered */ protected String title = TITLE_EDEFAULT; /** * The default value of the '{@link #getType() <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected static final TypeType TYPE_EDEFAULT = TypeType.RESOURCE_LITERAL; /** * The cached value of the '{@link #getType() <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected TypeType type = TYPE_EDEFAULT; /** * This is true if the Type attribute has been set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ protected boolean typeESet; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ResourceTypeImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EClass eStaticClass() { return XlinkPackage.Literals.RESOURCE_TYPE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLabel() { return label; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLabel(String newLabel) { String oldLabel = label; label = newLabel; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.RESOURCE_TYPE__LABEL, oldLabel, label)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getRole() { return role; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setRole(String newRole) { String oldRole = role; role = newRole; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.RESOURCE_TYPE__ROLE, oldRole, role)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getTitle() { return title; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setTitle(String newTitle) { String oldTitle = title; title = newTitle; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.RESOURCE_TYPE__TITLE, oldTitle, title)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType getType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(TypeType newType) { TypeType oldType = type; type = newType == null ? TYPE_EDEFAULT : newType; boolean oldTypeESet = typeESet; typeESet = true; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.RESOURCE_TYPE__TYPE, oldType, type, !oldTypeESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void unsetType() { TypeType oldType = type; boolean oldTypeESet = typeESet; type = TYPE_EDEFAULT; typeESet = false; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.UNSET, XlinkPackage.RESOURCE_TYPE__TYPE, oldType, TYPE_EDEFAULT, oldTypeESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isSetType() { return typeESet; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList getContents() { // TODO: implement this method to return the 'Contents' reference list // Ensure that you remove @generated or mark it @generated NOT // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used. throw new UnsupportedOperationException(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XlinkPackage.RESOURCE_TYPE__LABEL: return getLabel(); case XlinkPackage.RESOURCE_TYPE__ROLE: return getRole(); case XlinkPackage.RESOURCE_TYPE__TITLE: return getTitle(); case XlinkPackage.RESOURCE_TYPE__TYPE: return getType(); case XlinkPackage.RESOURCE_TYPE__CONTENTS: return getContents(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eSet(int featureID, Object newValue) { switch (featureID) { case XlinkPackage.RESOURCE_TYPE__LABEL: setLabel((String)newValue); return; case XlinkPackage.RESOURCE_TYPE__ROLE: setRole((String)newValue); return; case XlinkPackage.RESOURCE_TYPE__TITLE: setTitle((String)newValue); return; case XlinkPackage.RESOURCE_TYPE__TYPE: setType((TypeType)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eUnset(int featureID) { switch (featureID) { case XlinkPackage.RESOURCE_TYPE__LABEL: setLabel(LABEL_EDEFAULT); return; case XlinkPackage.RESOURCE_TYPE__ROLE: setRole(ROLE_EDEFAULT); return; case XlinkPackage.RESOURCE_TYPE__TITLE: setTitle(TITLE_EDEFAULT); return; case XlinkPackage.RESOURCE_TYPE__TYPE: unsetType(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean eIsSet(int featureID) { switch (featureID) { case XlinkPackage.RESOURCE_TYPE__LABEL: return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label); case XlinkPackage.RESOURCE_TYPE__ROLE: return ROLE_EDEFAULT == null ? role != null : !ROLE_EDEFAULT.equals(role); case XlinkPackage.RESOURCE_TYPE__TITLE: return TITLE_EDEFAULT == null ? title != null : !TITLE_EDEFAULT.equals(title); case XlinkPackage.RESOURCE_TYPE__TYPE: return isSetType(); case XlinkPackage.RESOURCE_TYPE__CONTENTS: return !getContents().isEmpty(); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (label: "); result.append(label); result.append(", role: "); result.append(role); result.append(", title: "); result.append(title); result.append(", type: "); if (typeESet) result.append(type); else result.append("<unset>"); result.append(')'); return result.toString(); } } //ResourceTypeImpl