001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: HTTPTypeImpl.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.HTTPType;
011: import net.opengis.ows.OwsPackage;
012:
013: import org.eclipse.emf.common.notify.NotificationChain;
014:
015: import org.eclipse.emf.common.util.EList;
016:
017: import org.eclipse.emf.ecore.EClass;
018: import org.eclipse.emf.ecore.InternalEObject;
019:
020: import org.eclipse.emf.ecore.impl.EObjectImpl;
021:
022: import org.eclipse.emf.ecore.util.BasicFeatureMap;
023: import org.eclipse.emf.ecore.util.FeatureMap;
024: import org.eclipse.emf.ecore.util.InternalEList;
025:
026: /**
027: * <!-- begin-user-doc -->
028: * An implementation of the model object '<em><b>HTTP Type</b></em>'.
029: * <!-- end-user-doc -->
030: * <p>
031: * The following features are implemented:
032: * <ul>
033: * <li>{@link net.opengis.ows.impl.HTTPTypeImpl#getGroup <em>Group</em>}</li>
034: * <li>{@link net.opengis.ows.impl.HTTPTypeImpl#getGet <em>Get</em>}</li>
035: * <li>{@link net.opengis.ows.impl.HTTPTypeImpl#getPost <em>Post</em>}</li>
036: * </ul>
037: * </p>
038: *
039: * @generated
040: */
041: public class HTTPTypeImpl extends EObjectImpl implements HTTPType {
042: /**
043: * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list.
044: * <!-- begin-user-doc -->
045: * <!-- end-user-doc -->
046: * @see #getGroup()
047: * @generated
048: * @ordered
049: */
050: protected FeatureMap group;
051:
052: /**
053: * <!-- begin-user-doc -->
054: * <!-- end-user-doc -->
055: * @generated
056: */
057: protected HTTPTypeImpl() {
058: super ();
059: }
060:
061: /**
062: * <!-- begin-user-doc -->
063: * <!-- end-user-doc -->
064: * @generated
065: */
066: protected EClass eStaticClass() {
067: return OwsPackage.Literals.HTTP_TYPE;
068: }
069:
070: /**
071: * <!-- begin-user-doc -->
072: * <!-- end-user-doc -->
073: * @generated
074: */
075: public FeatureMap getGroup() {
076: if (group == null) {
077: group = new BasicFeatureMap(this ,
078: OwsPackage.HTTP_TYPE__GROUP);
079: }
080: return group;
081: }
082:
083: /**
084: * <!-- begin-user-doc -->
085: * <!-- end-user-doc -->
086: * @generated
087: */
088: public EList getGet() {
089: return getGroup().list(OwsPackage.Literals.HTTP_TYPE__GET);
090: }
091:
092: /**
093: * <!-- begin-user-doc -->
094: * <!-- end-user-doc -->
095: * @generated
096: */
097: public EList getPost() {
098: return getGroup().list(OwsPackage.Literals.HTTP_TYPE__POST);
099: }
100:
101: /**
102: * <!-- begin-user-doc -->
103: * <!-- end-user-doc -->
104: * @generated
105: */
106: public NotificationChain eInverseRemove(InternalEObject otherEnd,
107: int featureID, NotificationChain msgs) {
108: switch (featureID) {
109: case OwsPackage.HTTP_TYPE__GROUP:
110: return ((InternalEList) getGroup()).basicRemove(otherEnd,
111: msgs);
112: case OwsPackage.HTTP_TYPE__GET:
113: return ((InternalEList) getGet()).basicRemove(otherEnd,
114: msgs);
115: case OwsPackage.HTTP_TYPE__POST:
116: return ((InternalEList) getPost()).basicRemove(otherEnd,
117: msgs);
118: }
119: return super .eInverseRemove(otherEnd, featureID, msgs);
120: }
121:
122: /**
123: * <!-- begin-user-doc -->
124: * <!-- end-user-doc -->
125: * @generated
126: */
127: public Object eGet(int featureID, boolean resolve, boolean coreType) {
128: switch (featureID) {
129: case OwsPackage.HTTP_TYPE__GROUP:
130: if (coreType)
131: return getGroup();
132: return ((FeatureMap.Internal) getGroup()).getWrapper();
133: case OwsPackage.HTTP_TYPE__GET:
134: return getGet();
135: case OwsPackage.HTTP_TYPE__POST:
136: return getPost();
137: }
138: return super .eGet(featureID, resolve, coreType);
139: }
140:
141: /**
142: * <!-- begin-user-doc -->
143: * <!-- end-user-doc -->
144: * @generated
145: */
146: public void eSet(int featureID, Object newValue) {
147: switch (featureID) {
148: case OwsPackage.HTTP_TYPE__GROUP:
149: ((FeatureMap.Internal) getGroup()).set(newValue);
150: return;
151: case OwsPackage.HTTP_TYPE__GET:
152: getGet().clear();
153: getGet().addAll((Collection) newValue);
154: return;
155: case OwsPackage.HTTP_TYPE__POST:
156: getPost().clear();
157: getPost().addAll((Collection) newValue);
158: return;
159: }
160: super .eSet(featureID, newValue);
161: }
162:
163: /**
164: * <!-- begin-user-doc -->
165: * <!-- end-user-doc -->
166: * @generated
167: */
168: public void eUnset(int featureID) {
169: switch (featureID) {
170: case OwsPackage.HTTP_TYPE__GROUP:
171: getGroup().clear();
172: return;
173: case OwsPackage.HTTP_TYPE__GET:
174: getGet().clear();
175: return;
176: case OwsPackage.HTTP_TYPE__POST:
177: getPost().clear();
178: return;
179: }
180: super .eUnset(featureID);
181: }
182:
183: /**
184: * <!-- begin-user-doc -->
185: * <!-- end-user-doc -->
186: * @generated
187: */
188: public boolean eIsSet(int featureID) {
189: switch (featureID) {
190: case OwsPackage.HTTP_TYPE__GROUP:
191: return group != null && !group.isEmpty();
192: case OwsPackage.HTTP_TYPE__GET:
193: return !getGet().isEmpty();
194: case OwsPackage.HTTP_TYPE__POST:
195: return !getPost().isEmpty();
196: }
197: return super .eIsSet(featureID);
198: }
199:
200: /**
201: * <!-- begin-user-doc -->
202: * <!-- end-user-doc -->
203: * @generated
204: */
205: public String toString() {
206: if (eIsProxy())
207: return super .toString();
208:
209: StringBuffer result = new StringBuffer(super .toString());
210: result.append(" (group: ");
211: result.append(group);
212: result.append(')');
213: return result.toString();
214: }
215:
216: } //HTTPTypeImpl
|