/**
*
*
*
* $Id$
*/
package net.opengis.wfs20.impl;
import net.opengis.wfs20.PropertyType;
import net.opengis.wfs20.ValueReferenceType;
import net.opengis.wfs20.Wfs20Package;
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.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.opengis.filter.expression.PropertyName;
/**
*
* An implementation of the model object 'Property Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.wfs20.impl.PropertyTypeImpl#getValueReference Value Reference}
* - {@link net.opengis.wfs20.impl.PropertyTypeImpl#getValue Value}
*
*
*
* @generated
*/
public class PropertyTypeImpl extends EObjectImpl implements PropertyType {
/**
* The cached value of the '{@link #getValueReference() Value Reference}' reference.
*
*
* @see #getValueReference()
* @generated
* @ordered
*/
protected ValueReferenceType valueReference;
/**
* The default value of the '{@link #getValue() Value}' attribute.
*
*
* @see #getValue()
* @generated
* @ordered
*/
protected static final Object VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValue() Value}' attribute.
*
*
* @see #getValue()
* @generated
* @ordered
*/
protected Object value = VALUE_EDEFAULT;
/**
*
*
* @generated
*/
protected PropertyTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Wfs20Package.Literals.PROPERTY_TYPE;
}
/**
*
*
* @generated
*/
public ValueReferenceType getValueReference() {
if (valueReference != null && valueReference.eIsProxy()) {
InternalEObject oldValueReference = (InternalEObject)valueReference;
valueReference = (ValueReferenceType)eResolveProxy(oldValueReference);
if (valueReference != oldValueReference) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, Wfs20Package.PROPERTY_TYPE__VALUE_REFERENCE, oldValueReference, valueReference));
}
}
return valueReference;
}
/**
*
*
* @generated
*/
public ValueReferenceType basicGetValueReference() {
return valueReference;
}
/**
*
*
* @generated
*/
public void setValueReference(ValueReferenceType newValueReference) {
ValueReferenceType oldValueReference = valueReference;
valueReference = newValueReference;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wfs20Package.PROPERTY_TYPE__VALUE_REFERENCE, oldValueReference, valueReference));
}
/**
*
*
* @generated
*/
public Object getValue() {
return value;
}
/**
*
*
* @generated
*/
public void setValue(Object newValue) {
Object oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wfs20Package.PROPERTY_TYPE__VALUE, oldValue, value));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Wfs20Package.PROPERTY_TYPE__VALUE_REFERENCE:
if (resolve) return getValueReference();
return basicGetValueReference();
case Wfs20Package.PROPERTY_TYPE__VALUE:
return getValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Wfs20Package.PROPERTY_TYPE__VALUE_REFERENCE:
setValueReference((ValueReferenceType)newValue);
return;
case Wfs20Package.PROPERTY_TYPE__VALUE:
setValue(newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Wfs20Package.PROPERTY_TYPE__VALUE_REFERENCE:
setValueReference((ValueReferenceType)null);
return;
case Wfs20Package.PROPERTY_TYPE__VALUE:
setValue(VALUE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Wfs20Package.PROPERTY_TYPE__VALUE_REFERENCE:
return valueReference != null;
case Wfs20Package.PROPERTY_TYPE__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
}
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(')');
return result.toString();
}
} //PropertyTypeImpl