001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: ExceptionTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.ows.impl;
007:
008: import java.util.Collection;
009:
010: import net.opengis.ows.ExceptionType;
011: import net.opengis.ows.OwsPackage;
012:
013: import org.eclipse.emf.common.notify.Notification;
014:
015: import org.eclipse.emf.common.util.EList;
016:
017: import org.eclipse.emf.ecore.EClass;
018:
019: import org.eclipse.emf.ecore.impl.ENotificationImpl;
020: import org.eclipse.emf.ecore.impl.EObjectImpl;
021:
022: import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
023:
024: /**
025: * <!-- begin-user-doc -->
026: * An implementation of the model object '<em><b>Exception Type</b></em>'.
027: * <!-- end-user-doc -->
028: * <p>
029: * The following features are implemented:
030: * <ul>
031: * <li>{@link net.opengis.ows.impl.ExceptionTypeImpl#getExceptionText <em>Exception Text</em>}</li>
032: * <li>{@link net.opengis.ows.impl.ExceptionTypeImpl#getExceptionCode <em>Exception Code</em>}</li>
033: * <li>{@link net.opengis.ows.impl.ExceptionTypeImpl#getLocator <em>Locator</em>}</li>
034: * </ul>
035: * </p>
036: *
037: * @generated
038: */
039: public class ExceptionTypeImpl extends EObjectImpl implements
040: ExceptionType {
041: /**
042: * The cached value of the '{@link #getExceptionText() <em>Exception Text</em>}' attribute list.
043: * <!-- begin-user-doc -->
044: * <!-- end-user-doc -->
045: * @see #getExceptionText()
046: * @generated
047: * @ordered
048: */
049: protected EList exceptionText;
050:
051: /**
052: * The default value of the '{@link #getExceptionCode() <em>Exception Code</em>}' attribute.
053: * <!-- begin-user-doc -->
054: * <!-- end-user-doc -->
055: * @see #getExceptionCode()
056: * @generated
057: * @ordered
058: */
059: protected static final String EXCEPTION_CODE_EDEFAULT = null;
060:
061: /**
062: * The cached value of the '{@link #getExceptionCode() <em>Exception Code</em>}' attribute.
063: * <!-- begin-user-doc -->
064: * <!-- end-user-doc -->
065: * @see #getExceptionCode()
066: * @generated
067: * @ordered
068: */
069: protected String exceptionCode = EXCEPTION_CODE_EDEFAULT;
070:
071: /**
072: * The default value of the '{@link #getLocator() <em>Locator</em>}' attribute.
073: * <!-- begin-user-doc -->
074: * <!-- end-user-doc -->
075: * @see #getLocator()
076: * @generated
077: * @ordered
078: */
079: protected static final String LOCATOR_EDEFAULT = null;
080:
081: /**
082: * The cached value of the '{@link #getLocator() <em>Locator</em>}' attribute.
083: * <!-- begin-user-doc -->
084: * <!-- end-user-doc -->
085: * @see #getLocator()
086: * @generated
087: * @ordered
088: */
089: protected String locator = LOCATOR_EDEFAULT;
090:
091: /**
092: * <!-- begin-user-doc -->
093: * <!-- end-user-doc -->
094: * @generated
095: */
096: protected ExceptionTypeImpl() {
097: super ();
098: }
099:
100: /**
101: * <!-- begin-user-doc -->
102: * <!-- end-user-doc -->
103: * @generated
104: */
105: protected EClass eStaticClass() {
106: return OwsPackage.Literals.EXCEPTION_TYPE;
107: }
108:
109: /**
110: * <!-- begin-user-doc -->
111: * <!-- end-user-doc -->
112: * @generated
113: */
114: public EList getExceptionText() {
115: if (exceptionText == null) {
116: exceptionText = new EDataTypeUniqueEList(String.class,
117: this , OwsPackage.EXCEPTION_TYPE__EXCEPTION_TEXT);
118: }
119: return exceptionText;
120: }
121:
122: /**
123: * <!-- begin-user-doc -->
124: * <!-- end-user-doc -->
125: * @generated
126: */
127: public String getExceptionCode() {
128: return exceptionCode;
129: }
130:
131: /**
132: * <!-- begin-user-doc -->
133: * <!-- end-user-doc -->
134: * @generated
135: */
136: public void setExceptionCode(String newExceptionCode) {
137: String oldExceptionCode = exceptionCode;
138: exceptionCode = newExceptionCode;
139: if (eNotificationRequired())
140: eNotify(new ENotificationImpl(this , Notification.SET,
141: OwsPackage.EXCEPTION_TYPE__EXCEPTION_CODE,
142: oldExceptionCode, exceptionCode));
143: }
144:
145: /**
146: * <!-- begin-user-doc -->
147: * <!-- end-user-doc -->
148: * @generated
149: */
150: public String getLocator() {
151: return locator;
152: }
153:
154: /**
155: * <!-- begin-user-doc -->
156: * <!-- end-user-doc -->
157: * @generated
158: */
159: public void setLocator(String newLocator) {
160: String oldLocator = locator;
161: locator = newLocator;
162: if (eNotificationRequired())
163: eNotify(new ENotificationImpl(this , Notification.SET,
164: OwsPackage.EXCEPTION_TYPE__LOCATOR, oldLocator,
165: locator));
166: }
167:
168: /**
169: * <!-- begin-user-doc -->
170: * <!-- end-user-doc -->
171: * @generated
172: */
173: public Object eGet(int featureID, boolean resolve, boolean coreType) {
174: switch (featureID) {
175: case OwsPackage.EXCEPTION_TYPE__EXCEPTION_TEXT:
176: return getExceptionText();
177: case OwsPackage.EXCEPTION_TYPE__EXCEPTION_CODE:
178: return getExceptionCode();
179: case OwsPackage.EXCEPTION_TYPE__LOCATOR:
180: return getLocator();
181: }
182: return super .eGet(featureID, resolve, coreType);
183: }
184:
185: /**
186: * <!-- begin-user-doc -->
187: * <!-- end-user-doc -->
188: * @generated
189: */
190: public void eSet(int featureID, Object newValue) {
191: switch (featureID) {
192: case OwsPackage.EXCEPTION_TYPE__EXCEPTION_TEXT:
193: getExceptionText().clear();
194: getExceptionText().addAll((Collection) newValue);
195: return;
196: case OwsPackage.EXCEPTION_TYPE__EXCEPTION_CODE:
197: setExceptionCode((String) newValue);
198: return;
199: case OwsPackage.EXCEPTION_TYPE__LOCATOR:
200: setLocator((String) newValue);
201: return;
202: }
203: super .eSet(featureID, newValue);
204: }
205:
206: /**
207: * <!-- begin-user-doc -->
208: * <!-- end-user-doc -->
209: * @generated
210: */
211: public void eUnset(int featureID) {
212: switch (featureID) {
213: case OwsPackage.EXCEPTION_TYPE__EXCEPTION_TEXT:
214: getExceptionText().clear();
215: return;
216: case OwsPackage.EXCEPTION_TYPE__EXCEPTION_CODE:
217: setExceptionCode(EXCEPTION_CODE_EDEFAULT);
218: return;
219: case OwsPackage.EXCEPTION_TYPE__LOCATOR:
220: setLocator(LOCATOR_EDEFAULT);
221: return;
222: }
223: super .eUnset(featureID);
224: }
225:
226: /**
227: * <!-- begin-user-doc -->
228: * <!-- end-user-doc -->
229: * @generated
230: */
231: public boolean eIsSet(int featureID) {
232: switch (featureID) {
233: case OwsPackage.EXCEPTION_TYPE__EXCEPTION_TEXT:
234: return exceptionText != null && !exceptionText.isEmpty();
235: case OwsPackage.EXCEPTION_TYPE__EXCEPTION_CODE:
236: return EXCEPTION_CODE_EDEFAULT == null ? exceptionCode != null
237: : !EXCEPTION_CODE_EDEFAULT.equals(exceptionCode);
238: case OwsPackage.EXCEPTION_TYPE__LOCATOR:
239: return LOCATOR_EDEFAULT == null ? locator != null
240: : !LOCATOR_EDEFAULT.equals(locator);
241: }
242: return super .eIsSet(featureID);
243: }
244:
245: /**
246: * <!-- begin-user-doc -->
247: * <!-- end-user-doc -->
248: * @generated
249: */
250: public String toString() {
251: if (eIsProxy())
252: return super .toString();
253:
254: StringBuffer result = new StringBuffer(super .toString());
255: result.append(" (exceptionText: ");
256: result.append(exceptionText);
257: result.append(", exceptionCode: ");
258: result.append(exceptionCode);
259: result.append(", locator: ");
260: result.append(locator);
261: result.append(')');
262: return result.toString();
263: }
264:
265: } //ExceptionTypeImpl
|