001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: PropertyTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.wfs.impl;
007:
008: import javax.xml.namespace.QName;
009:
010: import net.opengis.wfs.PropertyType;
011: import net.opengis.wfs.WfsPackage;
012:
013: import org.eclipse.emf.common.notify.Notification;
014:
015: import org.eclipse.emf.ecore.EClass;
016:
017: import org.eclipse.emf.ecore.impl.ENotificationImpl;
018: import org.eclipse.emf.ecore.impl.EObjectImpl;
019:
020: /**
021: * <!-- begin-user-doc -->
022: * An implementation of the model object '<em><b>Property Type</b></em>'.
023: * <!-- end-user-doc -->
024: * <p>
025: * The following features are implemented:
026: * <ul>
027: * <li>{@link net.opengis.wfs.impl.PropertyTypeImpl#getName <em>Name</em>}</li>
028: * <li>{@link net.opengis.wfs.impl.PropertyTypeImpl#getValue <em>Value</em>}</li>
029: * </ul>
030: * </p>
031: *
032: * @generated
033: */
034: public class PropertyTypeImpl extends EObjectImpl implements
035: PropertyType {
036: /**
037: * The default value of the '{@link #getName() <em>Name</em>}' attribute.
038: * <!-- begin-user-doc -->
039: * <!-- end-user-doc -->
040: * @see #getName()
041: * @generated
042: * @ordered
043: */
044: protected static final QName NAME_EDEFAULT = null;
045:
046: /**
047: * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
048: * <!-- begin-user-doc -->
049: * <!-- end-user-doc -->
050: * @see #getName()
051: * @generated
052: * @ordered
053: */
054: protected QName name = NAME_EDEFAULT;
055:
056: /**
057: * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
058: * <!-- begin-user-doc -->
059: * <!-- end-user-doc -->
060: * @see #getValue()
061: * @generated
062: * @ordered
063: */
064: protected static final Object VALUE_EDEFAULT = null;
065:
066: /**
067: * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
068: * <!-- begin-user-doc -->
069: * <!-- end-user-doc -->
070: * @see #getValue()
071: * @generated
072: * @ordered
073: */
074: protected Object value = VALUE_EDEFAULT;
075:
076: /**
077: * <!-- begin-user-doc -->
078: * <!-- end-user-doc -->
079: * @generated
080: */
081: protected PropertyTypeImpl() {
082: super ();
083: }
084:
085: /**
086: * <!-- begin-user-doc -->
087: * <!-- end-user-doc -->
088: * @generated
089: */
090: protected EClass eStaticClass() {
091: return WfsPackage.Literals.PROPERTY_TYPE;
092: }
093:
094: /**
095: * <!-- begin-user-doc -->
096: * <!-- end-user-doc -->
097: * @generated
098: */
099: public QName getName() {
100: return name;
101: }
102:
103: /**
104: * <!-- begin-user-doc -->
105: * <!-- end-user-doc -->
106: * @generated
107: */
108: public void setName(QName newName) {
109: QName oldName = name;
110: name = newName;
111: if (eNotificationRequired())
112: eNotify(new ENotificationImpl(this , Notification.SET,
113: WfsPackage.PROPERTY_TYPE__NAME, oldName, name));
114: }
115:
116: /**
117: * <!-- begin-user-doc -->
118: * <!-- end-user-doc -->
119: * @generated
120: */
121: public Object getValue() {
122: return value;
123: }
124:
125: /**
126: * <!-- begin-user-doc -->
127: * <!-- end-user-doc -->
128: * @generated
129: */
130: public void setValue(Object newValue) {
131: Object oldValue = value;
132: value = newValue;
133: if (eNotificationRequired())
134: eNotify(new ENotificationImpl(this , Notification.SET,
135: WfsPackage.PROPERTY_TYPE__VALUE, oldValue, value));
136: }
137:
138: /**
139: * <!-- begin-user-doc -->
140: * <!-- end-user-doc -->
141: * @generated
142: */
143: public Object eGet(int featureID, boolean resolve, boolean coreType) {
144: switch (featureID) {
145: case WfsPackage.PROPERTY_TYPE__NAME:
146: return getName();
147: case WfsPackage.PROPERTY_TYPE__VALUE:
148: return getValue();
149: }
150: return super .eGet(featureID, resolve, coreType);
151: }
152:
153: /**
154: * <!-- begin-user-doc -->
155: * <!-- end-user-doc -->
156: * @generated
157: */
158: public void eSet(int featureID, Object newValue) {
159: switch (featureID) {
160: case WfsPackage.PROPERTY_TYPE__NAME:
161: setName((QName) newValue);
162: return;
163: case WfsPackage.PROPERTY_TYPE__VALUE:
164: setValue(newValue);
165: return;
166: }
167: super .eSet(featureID, newValue);
168: }
169:
170: /**
171: * <!-- begin-user-doc -->
172: * <!-- end-user-doc -->
173: * @generated
174: */
175: public void eUnset(int featureID) {
176: switch (featureID) {
177: case WfsPackage.PROPERTY_TYPE__NAME:
178: setName(NAME_EDEFAULT);
179: return;
180: case WfsPackage.PROPERTY_TYPE__VALUE:
181: setValue(VALUE_EDEFAULT);
182: return;
183: }
184: super .eUnset(featureID);
185: }
186:
187: /**
188: * <!-- begin-user-doc -->
189: * <!-- end-user-doc -->
190: * @generated
191: */
192: public boolean eIsSet(int featureID) {
193: switch (featureID) {
194: case WfsPackage.PROPERTY_TYPE__NAME:
195: return NAME_EDEFAULT == null ? name != null
196: : !NAME_EDEFAULT.equals(name);
197: case WfsPackage.PROPERTY_TYPE__VALUE:
198: return VALUE_EDEFAULT == null ? value != null
199: : !VALUE_EDEFAULT.equals(value);
200: }
201: return super .eIsSet(featureID);
202: }
203:
204: /**
205: * <!-- begin-user-doc -->
206: * <!-- end-user-doc -->
207: * @generated
208: */
209: public String toString() {
210: if (eIsProxy())
211: return super .toString();
212:
213: StringBuffer result = new StringBuffer(super .toString());
214: result.append(" (name: ");
215: result.append(name);
216: result.append(", value: ");
217: result.append(value);
218: result.append(')');
219: return result.toString();
220: }
221:
222: } //PropertyTypeImpl
|