/**
*
*
*
* $Id$
*/
package net.opengis.wfs20.impl;
import javax.xml.namespace.QName;
import net.opengis.wfs20.UpdateActionType;
import net.opengis.wfs20.ValueReferenceType;
import net.opengis.wfs20.Wfs20Package;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
/**
*
* An implementation of the model object 'Value Reference Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.wfs20.impl.ValueReferenceTypeImpl#getValue Value}
* - {@link net.opengis.wfs20.impl.ValueReferenceTypeImpl#getAction Action}
*
*
*
* @generated
*/
public class ValueReferenceTypeImpl extends EObjectImpl implements ValueReferenceType {
/**
* The default value of the '{@link #getValue() Value}' attribute.
*
*
* @see #getValue()
* @generated
* @ordered
*/
protected static final QName VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValue() Value}' attribute.
*
*
* @see #getValue()
* @generated
* @ordered
*/
protected QName value = VALUE_EDEFAULT;
/**
* The default value of the '{@link #getAction() Action}' attribute.
*
*
* @see #getAction()
* @generated
* @ordered
*/
protected static final UpdateActionType ACTION_EDEFAULT = UpdateActionType.REPLACE;
/**
* The cached value of the '{@link #getAction() Action}' attribute.
*
*
* @see #getAction()
* @generated
* @ordered
*/
protected UpdateActionType action = ACTION_EDEFAULT;
/**
* This is true if the Action attribute has been set.
*
*
* @generated
* @ordered
*/
protected boolean actionESet;
/**
*
*
* @generated
*/
protected ValueReferenceTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Wfs20Package.Literals.VALUE_REFERENCE_TYPE;
}
/**
*
*
* @generated
*/
public QName getValue() {
return value;
}
/**
*
*
* @generated
*/
public void setValue(QName newValue) {
QName oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wfs20Package.VALUE_REFERENCE_TYPE__VALUE, oldValue, value));
}
/**
*
*
* @generated
*/
public UpdateActionType getAction() {
return action;
}
/**
*
*
* @generated
*/
public void setAction(UpdateActionType newAction) {
UpdateActionType oldAction = action;
action = newAction == null ? ACTION_EDEFAULT : newAction;
boolean oldActionESet = actionESet;
actionESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wfs20Package.VALUE_REFERENCE_TYPE__ACTION, oldAction, action, !oldActionESet));
}
/**
*
*
* @generated
*/
public void unsetAction() {
UpdateActionType oldAction = action;
boolean oldActionESet = actionESet;
action = ACTION_EDEFAULT;
actionESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, Wfs20Package.VALUE_REFERENCE_TYPE__ACTION, oldAction, ACTION_EDEFAULT, oldActionESet));
}
/**
*
*
* @generated
*/
public boolean isSetAction() {
return actionESet;
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Wfs20Package.VALUE_REFERENCE_TYPE__VALUE:
return getValue();
case Wfs20Package.VALUE_REFERENCE_TYPE__ACTION:
return getAction();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Wfs20Package.VALUE_REFERENCE_TYPE__VALUE:
setValue((QName)newValue);
return;
case Wfs20Package.VALUE_REFERENCE_TYPE__ACTION:
setAction((UpdateActionType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Wfs20Package.VALUE_REFERENCE_TYPE__VALUE:
setValue(VALUE_EDEFAULT);
return;
case Wfs20Package.VALUE_REFERENCE_TYPE__ACTION:
unsetAction();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Wfs20Package.VALUE_REFERENCE_TYPE__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
case Wfs20Package.VALUE_REFERENCE_TYPE__ACTION:
return isSetAction();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (value: ");
result.append(value);
result.append(", action: ");
if (actionESet) result.append(action); else result.append("");
result.append(')');
return result.toString();
}
} //ValueReferenceTypeImpl