/**
*
*
*
* $Id$
*/
package net.opengis.fes20.impl;
import javax.xml.namespace.QName;
import net.opengis.fes20.Fes20Package;
import net.opengis.fes20.ResourceIdentifierType;
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 'Resource Identifier Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.fes20.impl.ResourceIdentifierTypeImpl#getMetadata Metadata}
* - {@link net.opengis.fes20.impl.ResourceIdentifierTypeImpl#getName Name}
*
*
*
* @generated
*/
public class ResourceIdentifierTypeImpl extends EObjectImpl implements ResourceIdentifierType {
/**
* The cached value of the '{@link #getMetadata() Metadata}' containment reference.
*
*
* @see #getMetadata()
* @generated
* @ordered
*/
protected MetadataType metadata;
/**
* The default value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected static final QName NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected QName name = NAME_EDEFAULT;
/**
*
*
* @generated
*/
protected ResourceIdentifierTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Fes20Package.Literals.RESOURCE_IDENTIFIER_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.RESOURCE_IDENTIFIER_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.RESOURCE_IDENTIFIER_TYPE__METADATA, null, msgs);
if (newMetadata != null)
msgs = ((InternalEObject)newMetadata).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Fes20Package.RESOURCE_IDENTIFIER_TYPE__METADATA, null, msgs);
msgs = basicSetMetadata(newMetadata, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Fes20Package.RESOURCE_IDENTIFIER_TYPE__METADATA, newMetadata, newMetadata));
}
/**
*
*
* @generated
*/
public QName getName() {
return name;
}
/**
*
*
* @generated
*/
public void setName(QName newName) {
QName oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Fes20Package.RESOURCE_IDENTIFIER_TYPE__NAME, oldName, name));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Fes20Package.RESOURCE_IDENTIFIER_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.RESOURCE_IDENTIFIER_TYPE__METADATA:
return getMetadata();
case Fes20Package.RESOURCE_IDENTIFIER_TYPE__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Fes20Package.RESOURCE_IDENTIFIER_TYPE__METADATA:
setMetadata((MetadataType)newValue);
return;
case Fes20Package.RESOURCE_IDENTIFIER_TYPE__NAME:
setName((QName)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Fes20Package.RESOURCE_IDENTIFIER_TYPE__METADATA:
setMetadata((MetadataType)null);
return;
case Fes20Package.RESOURCE_IDENTIFIER_TYPE__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Fes20Package.RESOURCE_IDENTIFIER_TYPE__METADATA:
return metadata != null;
case Fes20Package.RESOURCE_IDENTIFIER_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(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //ResourceIdentifierTypeImpl