/**
*
*
*
* $Id$
*/
package net.opengis.fes20.impl;
import javax.xml.namespace.QName;
import net.opengis.fes20.ArgumentType;
import net.opengis.fes20.Fes20Package;
import net.opengis.ows11.MetadataType;
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;
/**
*
* An implementation of the model object 'Argument Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.fes20.impl.ArgumentTypeImpl#getMetadata Metadata}
* - {@link net.opengis.fes20.impl.ArgumentTypeImpl#getType Type}
* - {@link net.opengis.fes20.impl.ArgumentTypeImpl#getName Name}
*
*
*
* @generated
*/
public class ArgumentTypeImpl extends EObjectImpl implements ArgumentType {
/**
* The cached value of the '{@link #getMetadata() Metadata}' containment reference.
*
*
* @see #getMetadata()
* @generated
* @ordered
*/
protected MetadataType metadata;
/**
* The default value of the '{@link #getType() Type}' attribute.
*
*
* @see #getType()
* @generated
* @ordered
*/
protected static final QName TYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getType() Type}' attribute.
*
*
* @see #getType()
* @generated
* @ordered
*/
protected QName type = TYPE_EDEFAULT;
/**
* The default value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
*
*
* @generated
*/
protected ArgumentTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Fes20Package.Literals.ARGUMENT_TYPE;
}
/**
*
*
* @generated
*/
public MetadataType getMetadata() {
return metadata;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetMetadata(MetadataType newMetadata, NotificationChain msgs) {
MetadataType oldMetadata = metadata;
metadata = newMetadata;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Fes20Package.ARGUMENT_TYPE__METADATA, oldMetadata, newMetadata);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setMetadata(MetadataType newMetadata) {
if (newMetadata != metadata) {
NotificationChain msgs = null;
if (metadata != null)
msgs = ((InternalEObject)metadata).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Fes20Package.ARGUMENT_TYPE__METADATA, null, msgs);
if (newMetadata != null)
msgs = ((InternalEObject)newMetadata).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Fes20Package.ARGUMENT_TYPE__METADATA, null, msgs);
msgs = basicSetMetadata(newMetadata, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Fes20Package.ARGUMENT_TYPE__METADATA, newMetadata, newMetadata));
}
/**
*
*
* @generated
*/
public QName getType() {
return type;
}
/**
*
*
* @generated
*/
public void setType(QName newType) {
QName oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Fes20Package.ARGUMENT_TYPE__TYPE, oldType, type));
}
/**
*
*
* @generated
*/
public String getName() {
return name;
}
/**
*
*
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Fes20Package.ARGUMENT_TYPE__NAME, oldName, name));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Fes20Package.ARGUMENT_TYPE__METADATA:
return basicSetMetadata(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Fes20Package.ARGUMENT_TYPE__METADATA:
return getMetadata();
case Fes20Package.ARGUMENT_TYPE__TYPE:
return getType();
case Fes20Package.ARGUMENT_TYPE__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Fes20Package.ARGUMENT_TYPE__METADATA:
setMetadata((MetadataType)newValue);
return;
case Fes20Package.ARGUMENT_TYPE__TYPE:
setType((QName)newValue);
return;
case Fes20Package.ARGUMENT_TYPE__NAME:
setName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Fes20Package.ARGUMENT_TYPE__METADATA:
setMetadata((MetadataType)null);
return;
case Fes20Package.ARGUMENT_TYPE__TYPE:
setType(TYPE_EDEFAULT);
return;
case Fes20Package.ARGUMENT_TYPE__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Fes20Package.ARGUMENT_TYPE__METADATA:
return metadata != null;
case Fes20Package.ARGUMENT_TYPE__TYPE:
return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
case Fes20Package.ARGUMENT_TYPE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (type: ");
result.append(type);
result.append(", name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //ArgumentTypeImpl