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