blob: 33dbe1fcae0a54c78494e00cd88894b6c5fa61ae [file] [log] [blame]
/**
* Copyright (c) 2010 Mia-Software.
* 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:
*
* Nicolas Guyomar (Mia-Software) - initial API and implementation
*/
package org.eclipse.modisco.jee.webapp.webapp30.impl;
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.webapp.webapp30.AddressingResponsesType;
import org.eclipse.modisco.jee.webapp.webapp30.AddressingType;
import org.eclipse.modisco.jee.webapp.webapp30.TrueFalseType;
import org.eclipse.modisco.jee.webapp.webapp30.Webapp30Package;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Addressing Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.modisco.jee.webapp.webapp30.impl.AddressingTypeImpl#getEnabled <em>Enabled</em>}</li>
* <li>{@link org.eclipse.modisco.jee.webapp.webapp30.impl.AddressingTypeImpl#getRequired <em>Required</em>}</li>
* <li>{@link org.eclipse.modisco.jee.webapp.webapp30.impl.AddressingTypeImpl#getResponses <em>Responses</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AddressingTypeImpl extends EObjectImpl implements AddressingType {
/**
* The cached value of the '{@link #getEnabled() <em>Enabled</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEnabled()
* @generated
* @ordered
*/
protected TrueFalseType enabled;
/**
* The cached value of the '{@link #getRequired() <em>Required</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRequired()
* @generated
* @ordered
*/
protected TrueFalseType required;
/**
* The cached value of the '{@link #getResponses() <em>Responses</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResponses()
* @generated
* @ordered
*/
protected AddressingResponsesType responses;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AddressingTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Webapp30Package.eINSTANCE.getAddressingType();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TrueFalseType getEnabled() {
return enabled;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetEnabled(TrueFalseType newEnabled, NotificationChain msgs) {
TrueFalseType oldEnabled = enabled;
enabled = newEnabled;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Webapp30Package.ADDRESSING_TYPE__ENABLED, oldEnabled, newEnabled);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEnabled(TrueFalseType newEnabled) {
if (newEnabled != enabled) {
NotificationChain msgs = null;
if (enabled != null)
msgs = ((InternalEObject)enabled).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Webapp30Package.ADDRESSING_TYPE__ENABLED, null, msgs);
if (newEnabled != null)
msgs = ((InternalEObject)newEnabled).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Webapp30Package.ADDRESSING_TYPE__ENABLED, null, msgs);
msgs = basicSetEnabled(newEnabled, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Webapp30Package.ADDRESSING_TYPE__ENABLED, newEnabled, newEnabled));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TrueFalseType getRequired() {
return required;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRequired(TrueFalseType newRequired, NotificationChain msgs) {
TrueFalseType oldRequired = required;
required = newRequired;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Webapp30Package.ADDRESSING_TYPE__REQUIRED, oldRequired, newRequired);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRequired(TrueFalseType newRequired) {
if (newRequired != required) {
NotificationChain msgs = null;
if (required != null)
msgs = ((InternalEObject)required).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Webapp30Package.ADDRESSING_TYPE__REQUIRED, null, msgs);
if (newRequired != null)
msgs = ((InternalEObject)newRequired).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Webapp30Package.ADDRESSING_TYPE__REQUIRED, null, msgs);
msgs = basicSetRequired(newRequired, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Webapp30Package.ADDRESSING_TYPE__REQUIRED, newRequired, newRequired));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AddressingResponsesType getResponses() {
return responses;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetResponses(AddressingResponsesType newResponses, NotificationChain msgs) {
AddressingResponsesType oldResponses = responses;
responses = newResponses;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Webapp30Package.ADDRESSING_TYPE__RESPONSES, oldResponses, newResponses);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setResponses(AddressingResponsesType newResponses) {
if (newResponses != responses) {
NotificationChain msgs = null;
if (responses != null)
msgs = ((InternalEObject)responses).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Webapp30Package.ADDRESSING_TYPE__RESPONSES, null, msgs);
if (newResponses != null)
msgs = ((InternalEObject)newResponses).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Webapp30Package.ADDRESSING_TYPE__RESPONSES, null, msgs);
msgs = basicSetResponses(newResponses, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Webapp30Package.ADDRESSING_TYPE__RESPONSES, newResponses, newResponses));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Webapp30Package.ADDRESSING_TYPE__ENABLED:
return basicSetEnabled(null, msgs);
case Webapp30Package.ADDRESSING_TYPE__REQUIRED:
return basicSetRequired(null, msgs);
case Webapp30Package.ADDRESSING_TYPE__RESPONSES:
return basicSetResponses(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 Webapp30Package.ADDRESSING_TYPE__ENABLED:
return getEnabled();
case Webapp30Package.ADDRESSING_TYPE__REQUIRED:
return getRequired();
case Webapp30Package.ADDRESSING_TYPE__RESPONSES:
return getResponses();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Webapp30Package.ADDRESSING_TYPE__ENABLED:
setEnabled((TrueFalseType)newValue);
return;
case Webapp30Package.ADDRESSING_TYPE__REQUIRED:
setRequired((TrueFalseType)newValue);
return;
case Webapp30Package.ADDRESSING_TYPE__RESPONSES:
setResponses((AddressingResponsesType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Webapp30Package.ADDRESSING_TYPE__ENABLED:
setEnabled((TrueFalseType)null);
return;
case Webapp30Package.ADDRESSING_TYPE__REQUIRED:
setRequired((TrueFalseType)null);
return;
case Webapp30Package.ADDRESSING_TYPE__RESPONSES:
setResponses((AddressingResponsesType)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Webapp30Package.ADDRESSING_TYPE__ENABLED:
return enabled != null;
case Webapp30Package.ADDRESSING_TYPE__REQUIRED:
return required != null;
case Webapp30Package.ADDRESSING_TYPE__RESPONSES:
return responses != null;
}
return super.eIsSet(featureID);
}
} //AddressingTypeImpl