| /*************************************************************************************************** |
| * Copyright (c) 2005 Eteration A.S. and Gorkem Ercan. 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: Gorkem Ercan - initial API and implementation |
| * |
| **************************************************************************************************/ |
| package org.eclipse.jst.server.generic.internal.servertype.definition.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| 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.jst.server.generic.internal.servertype.definition.ServerTypePackage; |
| import org.eclipse.jst.server.generic.servertype.definition.Port; |
| |
| |
| |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Port</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jst.server.generic.internal.servertype.definition.impl.PortImpl#getNo <em>No</em>}</li> |
| * <li>{@link org.eclipse.jst.server.generic.internal.servertype.definition.impl.PortImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.jst.server.generic.internal.servertype.definition.impl.PortImpl#getProtocol <em>Protocol</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class PortImpl extends EObjectImpl implements Port { |
| /** |
| * The default value of the '{@link #getNo() <em>No</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNo() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NO_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getNo() <em>No</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNo() |
| * @generated |
| * @ordered |
| */ |
| protected String no = NO_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getProtocol() <em>Protocol</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProtocol() |
| * @generated |
| * @ordered |
| */ |
| protected static final String PROTOCOL_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getProtocol() <em>Protocol</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProtocol() |
| * @generated |
| * @ordered |
| */ |
| protected String protocol = PROTOCOL_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PortImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return ServerTypePackage.eINSTANCE.getPort(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getNo() { |
| return no; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setNo(String newNo) { |
| String oldNo = no; |
| no = newNo; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ServerTypePackage.PORT__NO, oldNo, no)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ServerTypePackage.PORT__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getProtocol() { |
| return protocol; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setProtocol(String newProtocol) { |
| String oldProtocol = protocol; |
| protocol = newProtocol; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ServerTypePackage.PORT__PROTOCOL, oldProtocol, protocol)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(EStructuralFeature eFeature, boolean resolve) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ServerTypePackage.PORT__NO: |
| return getNo(); |
| case ServerTypePackage.PORT__NAME: |
| return getName(); |
| case ServerTypePackage.PORT__PROTOCOL: |
| return getProtocol(); |
| } |
| return eDynamicGet(eFeature, resolve); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(EStructuralFeature eFeature, Object newValue) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ServerTypePackage.PORT__NO: |
| setNo((String)newValue); |
| return; |
| case ServerTypePackage.PORT__NAME: |
| setName((String)newValue); |
| return; |
| case ServerTypePackage.PORT__PROTOCOL: |
| setProtocol((String)newValue); |
| return; |
| } |
| eDynamicSet(eFeature, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ServerTypePackage.PORT__NO: |
| setNo(NO_EDEFAULT); |
| return; |
| case ServerTypePackage.PORT__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case ServerTypePackage.PORT__PROTOCOL: |
| setProtocol(PROTOCOL_EDEFAULT); |
| return; |
| } |
| eDynamicUnset(eFeature); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ServerTypePackage.PORT__NO: |
| return NO_EDEFAULT == null ? no != null : !NO_EDEFAULT.equals(no); |
| case ServerTypePackage.PORT__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case ServerTypePackage.PORT__PROTOCOL: |
| return PROTOCOL_EDEFAULT == null ? protocol != null : !PROTOCOL_EDEFAULT.equals(protocol); |
| } |
| 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(" (no: "); |
| result.append(no); |
| result.append(", name: "); |
| result.append(name); |
| result.append(", protocol: "); |
| result.append(protocol); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //PortImpl |