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