| /**
|
| * Copyright (c) 2010, 2019 Mia-Software and others.
|
| * All rights reserved. This program and the accompanying materials
|
| * are made available under the terms of the Eclipse Public License v2.0
|
| * which accompanies this distribution, and is available at
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| *
|
| * Nicolas Guyomar (Mia-Software) - initial API and implementation
|
| */ |
| package org.eclipse.modisco.jee.ejbjar.EjbJar30.impl;
|
|
|
| import java.lang.String;
|
|
|
| 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.modisco.jee.ejbjar.EjbJar30.EjbJar30Package;
|
| import org.eclipse.modisco.jee.ejbjar.EjbJar30.PropertyType;
|
| import org.eclipse.modisco.jee.ejbjar.EjbJar30.XsdStringType;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * An implementation of the model object '<em><b>Property Type</b></em>'.
|
| * <!-- end-user-doc -->
|
| * <p>
|
| * The following features are implemented:
|
| * <ul>
|
| * <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar30.impl.PropertyTypeImpl#getName <em>Name</em>}</li>
|
| * <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar30.impl.PropertyTypeImpl#getValue <em>Value</em>}</li>
|
| * <li>{@link org.eclipse.modisco.jee.ejbjar.EjbJar30.impl.PropertyTypeImpl#getId <em>Id</em>}</li>
|
| * </ul>
|
| * </p>
|
| *
|
| * @generated
|
| */
|
| public class PropertyTypeImpl extends EObjectImpl implements PropertyType {
|
| /**
|
| * The cached value of the '{@link #getName() <em>Name</em>}' containment reference.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getName()
|
| * @generated
|
| * @ordered
|
| */
|
| protected XsdStringType name;
|
|
|
| /**
|
| * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getValue()
|
| * @generated
|
| * @ordered
|
| */
|
| protected XsdStringType value;
|
|
|
| /**
|
| * The default value of the '{@link #getId() <em>Id</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getId()
|
| * @generated
|
| * @ordered
|
| */
|
| protected static final String ID_EDEFAULT = null;
|
|
|
| /**
|
| * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getId()
|
| * @generated
|
| * @ordered
|
| */
|
| protected String id = ID_EDEFAULT;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| protected PropertyTypeImpl() {
|
| super();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| protected EClass eStaticClass() {
|
| return EjbJar30Package.eINSTANCE.getPropertyType();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public XsdStringType getName() {
|
| return name;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public NotificationChain basicSetName(XsdStringType newName, NotificationChain msgs) {
|
| XsdStringType oldName = name;
|
| name = newName;
|
| if (eNotificationRequired()) {
|
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EjbJar30Package.PROPERTY_TYPE__NAME, oldName, newName);
|
| if (msgs == null) msgs = notification; else msgs.add(notification);
|
| }
|
| return msgs;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setName(XsdStringType newName) {
|
| if (newName != name) {
|
| NotificationChain msgs = null;
|
| if (name != null)
|
| msgs = ((InternalEObject)name).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EjbJar30Package.PROPERTY_TYPE__NAME, null, msgs);
|
| if (newName != null)
|
| msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EjbJar30Package.PROPERTY_TYPE__NAME, null, msgs);
|
| msgs = basicSetName(newName, msgs);
|
| if (msgs != null) msgs.dispatch();
|
| }
|
| else if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, EjbJar30Package.PROPERTY_TYPE__NAME, newName, newName));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public XsdStringType getValue() {
|
| return value;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public NotificationChain basicSetValue(XsdStringType newValue, NotificationChain msgs) {
|
| XsdStringType oldValue = value;
|
| value = newValue;
|
| if (eNotificationRequired()) {
|
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EjbJar30Package.PROPERTY_TYPE__VALUE, oldValue, newValue);
|
| if (msgs == null) msgs = notification; else msgs.add(notification);
|
| }
|
| return msgs;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setValue(XsdStringType newValue) {
|
| if (newValue != value) {
|
| NotificationChain msgs = null;
|
| if (value != null)
|
| msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EjbJar30Package.PROPERTY_TYPE__VALUE, null, msgs);
|
| if (newValue != null)
|
| msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EjbJar30Package.PROPERTY_TYPE__VALUE, null, msgs);
|
| msgs = basicSetValue(newValue, msgs);
|
| if (msgs != null) msgs.dispatch();
|
| }
|
| else if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, EjbJar30Package.PROPERTY_TYPE__VALUE, newValue, newValue));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public String getId() {
|
| return id;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setId(String newId) {
|
| String oldId = id;
|
| id = newId;
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, EjbJar30Package.PROPERTY_TYPE__ID, oldId, id));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
| switch (featureID) {
|
| case EjbJar30Package.PROPERTY_TYPE__NAME:
|
| return basicSetName(null, msgs);
|
| case EjbJar30Package.PROPERTY_TYPE__VALUE:
|
| return basicSetValue(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 EjbJar30Package.PROPERTY_TYPE__NAME:
|
| return getName();
|
| case EjbJar30Package.PROPERTY_TYPE__VALUE:
|
| return getValue();
|
| case EjbJar30Package.PROPERTY_TYPE__ID:
|
| return getId();
|
| }
|
| return super.eGet(featureID, resolve, coreType);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eSet(int featureID, Object newValue) {
|
| switch (featureID) {
|
| case EjbJar30Package.PROPERTY_TYPE__NAME:
|
| setName((XsdStringType)newValue);
|
| return;
|
| case EjbJar30Package.PROPERTY_TYPE__VALUE:
|
| setValue((XsdStringType)newValue);
|
| return;
|
| case EjbJar30Package.PROPERTY_TYPE__ID:
|
| setId((String)newValue);
|
| return;
|
| }
|
| super.eSet(featureID, newValue);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eUnset(int featureID) {
|
| switch (featureID) {
|
| case EjbJar30Package.PROPERTY_TYPE__NAME:
|
| setName((XsdStringType)null);
|
| return;
|
| case EjbJar30Package.PROPERTY_TYPE__VALUE:
|
| setValue((XsdStringType)null);
|
| return;
|
| case EjbJar30Package.PROPERTY_TYPE__ID:
|
| setId(ID_EDEFAULT);
|
| return;
|
| }
|
| super.eUnset(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public boolean eIsSet(int featureID) {
|
| switch (featureID) {
|
| case EjbJar30Package.PROPERTY_TYPE__NAME:
|
| return name != null;
|
| case EjbJar30Package.PROPERTY_TYPE__VALUE:
|
| return value != null;
|
| case EjbJar30Package.PROPERTY_TYPE__ID:
|
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
|
| }
|
| return super.eIsSet(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public String toString() {
|
| if (eIsProxy()) return super.toString();
|
|
|
| StringBuffer result = new StringBuffer(super.toString());
|
| result.append(" (id: "); //$NON-NLS-1$
|
| result.append(id);
|
| result.append(')');
|
| return result.toString();
|
| }
|
|
|
| } //PropertyTypeImpl
|