| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id: IModuleTypeImpl.java,v 1.4 2005/01/26 16:48:35 cbridgha Exp $ |
| */ |
| package org.eclipse.wst.common.modulecore.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.common.util.URI; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; |
| import org.eclipse.wst.common.modulecore.IModuleType; |
| import org.eclipse.wst.common.modulecore.ModuleCorePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>IModule Type</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.wst.common.modulecore.impl.IModuleTypeImpl#getRoot <em>Root</em>}</li> |
| * <li>{@link org.eclipse.wst.common.modulecore.impl.IModuleTypeImpl#getMetadataResources <em>Metadata Resources</em>}</li> |
| * <li>{@link org.eclipse.wst.common.modulecore.impl.IModuleTypeImpl#getTypeName <em>Type Name</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class IModuleTypeImpl extends EObjectImpl implements IModuleType { |
| /** |
| * The default value of the '{@link #getRoot() <em>Root</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRoot() |
| * @generated |
| * @ordered |
| */ |
| protected static final URI ROOT_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getRoot() <em>Root</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRoot() |
| * @generated |
| * @ordered |
| */ |
| protected URI root = ROOT_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getMetadataResources() <em>Metadata Resources</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMetadataResources() |
| * @generated |
| * @ordered |
| */ |
| protected EList metadataResources = null; |
| |
| /** |
| * The default value of the '{@link #getTypeName() <em>Type Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypeName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TYPE_NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getTypeName() <em>Type Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypeName() |
| * @generated |
| * @ordered |
| */ |
| protected String typeName = TYPE_NAME_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected IModuleTypeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return ModuleCorePackage.eINSTANCE.getIModuleType(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public URI getRoot() { |
| return root; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRoot(URI newRoot) { |
| URI oldRoot = root; |
| root = newRoot; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ModuleCorePackage.IMODULE_TYPE__ROOT, oldRoot, root)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList getMetadataResources() { |
| if (metadataResources == null) { |
| metadataResources = new EDataTypeUniqueEList(URI.class, this, ModuleCorePackage.IMODULE_TYPE__METADATA_RESOURCES); |
| } |
| return metadataResources; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getTypeName() { |
| return typeName; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTypeName(String newTypeName) { |
| String oldTypeName = typeName; |
| typeName = newTypeName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ModuleCorePackage.IMODULE_TYPE__TYPE_NAME, oldTypeName, typeName)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(EStructuralFeature eFeature, boolean resolve) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ModuleCorePackage.IMODULE_TYPE__ROOT: |
| return getRoot(); |
| case ModuleCorePackage.IMODULE_TYPE__METADATA_RESOURCES: |
| return getMetadataResources(); |
| case ModuleCorePackage.IMODULE_TYPE__TYPE_NAME: |
| return getTypeName(); |
| } |
| return eDynamicGet(eFeature, resolve); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(EStructuralFeature eFeature, Object newValue) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ModuleCorePackage.IMODULE_TYPE__ROOT: |
| setRoot((URI)newValue); |
| return; |
| case ModuleCorePackage.IMODULE_TYPE__METADATA_RESOURCES: |
| getMetadataResources().clear(); |
| getMetadataResources().addAll((Collection)newValue); |
| return; |
| case ModuleCorePackage.IMODULE_TYPE__TYPE_NAME: |
| setTypeName((String)newValue); |
| return; |
| } |
| eDynamicSet(eFeature, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ModuleCorePackage.IMODULE_TYPE__ROOT: |
| setRoot(ROOT_EDEFAULT); |
| return; |
| case ModuleCorePackage.IMODULE_TYPE__METADATA_RESOURCES: |
| getMetadataResources().clear(); |
| return; |
| case ModuleCorePackage.IMODULE_TYPE__TYPE_NAME: |
| setTypeName(TYPE_NAME_EDEFAULT); |
| return; |
| } |
| eDynamicUnset(eFeature); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ModuleCorePackage.IMODULE_TYPE__ROOT: |
| return ROOT_EDEFAULT == null ? root != null : !ROOT_EDEFAULT.equals(root); |
| case ModuleCorePackage.IMODULE_TYPE__METADATA_RESOURCES: |
| return metadataResources != null && !metadataResources.isEmpty(); |
| case ModuleCorePackage.IMODULE_TYPE__TYPE_NAME: |
| return TYPE_NAME_EDEFAULT == null ? typeName != null : !TYPE_NAME_EDEFAULT.equals(typeName); |
| } |
| return eDynamicIsSet(eFeature); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (root: "); |
| result.append(root); |
| result.append(", metadataResources: "); |
| result.append(metadataResources); |
| result.append(", typeName: "); |
| result.append(typeName); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //IModuleTypeImpl |