| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package LqnCore.impl; |
| 8 | |
| 9 | import LqnCore.DocumentRoot; |
| 10 | import LqnCore.LqnCorePackage; |
| 11 | import LqnCore.LqnCoreType; |
| 12 | import LqnCore.LqnModelType; |
| 13 | |
| 14 | import org.eclipse.emf.common.notify.NotificationChain; |
| 15 | |
| 16 | import org.eclipse.emf.common.util.EMap; |
| 17 | |
| 18 | import org.eclipse.emf.ecore.EClass; |
| 19 | import org.eclipse.emf.ecore.EStructuralFeature; |
| 20 | import org.eclipse.emf.ecore.EcorePackage; |
| 21 | import org.eclipse.emf.ecore.InternalEObject; |
| 22 | |
| 23 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 24 | import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; |
| 25 | |
| 26 | import org.eclipse.emf.ecore.util.BasicFeatureMap; |
| 27 | import org.eclipse.emf.ecore.util.EcoreEMap; |
| 28 | import org.eclipse.emf.ecore.util.FeatureMap; |
| 29 | import org.eclipse.emf.ecore.util.InternalEList; |
| 30 | |
| 31 | /** |
| 32 | * <!-- begin-user-doc --> |
| 33 | * An implementation of the model object '<em><b>Document Root</b></em>'. |
| 34 | * <!-- end-user-doc --> |
| 35 | * <p> |
| 36 | * The following features are implemented: |
| 37 | * <ul> |
| 38 | * <li>{@link LqnCore.impl.DocumentRootImpl#getMixed <em>Mixed</em>}</li> |
| 39 | * <li>{@link LqnCore.impl.DocumentRootImpl#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li> |
| 40 | * <li>{@link LqnCore.impl.DocumentRootImpl#getXSISchemaLocation <em>XSI Schema Location</em>}</li> |
| 41 | * <li>{@link LqnCore.impl.DocumentRootImpl#getLqnCore <em>Lqn Core</em>}</li> |
| 42 | * <li>{@link LqnCore.impl.DocumentRootImpl#getLqnModel <em>Lqn Model</em>}</li> |
| 43 | * </ul> |
| 44 | * </p> |
| 45 | * |
| 46 | * @generated |
| 47 | */ |
| 48 | public class DocumentRootImpl extends EObjectImpl implements DocumentRoot { |
| 49 | /** |
| 50 | * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list. |
| 51 | * <!-- begin-user-doc --> |
| 52 | * <!-- end-user-doc --> |
| 53 | * @see #getMixed() |
| 54 | * @generated |
| 55 | * @ordered |
| 56 | */ |
| 57 | protected FeatureMap mixed; |
| 58 | |
| 59 | /** |
| 60 | * The cached value of the '{@link #getXMLNSPrefixMap() <em>XMLNS Prefix Map</em>}' map. |
| 61 | * <!-- begin-user-doc --> |
| 62 | * <!-- end-user-doc --> |
| 63 | * @see #getXMLNSPrefixMap() |
| 64 | * @generated |
| 65 | * @ordered |
| 66 | */ |
| 67 | protected EMap<String, String> xMLNSPrefixMap; |
| 68 | |
| 69 | /** |
| 70 | * The cached value of the '{@link #getXSISchemaLocation() <em>XSI Schema Location</em>}' map. |
| 71 | * <!-- begin-user-doc --> |
| 72 | * <!-- end-user-doc --> |
| 73 | * @see #getXSISchemaLocation() |
| 74 | * @generated |
| 75 | * @ordered |
| 76 | */ |
| 77 | protected EMap<String, String> xSISchemaLocation; |
| 78 | |
| 79 | /** |
| 80 | * <!-- begin-user-doc --> |
| 81 | * <!-- end-user-doc --> |
| 82 | * @generated |
| 83 | */ |
| 84 | protected DocumentRootImpl() { |
| 85 | super(); |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * <!-- begin-user-doc --> |
| 90 | * <!-- end-user-doc --> |
| 91 | * @generated |
| 92 | */ |
| 93 | @Override |
| 94 | protected EClass eStaticClass() { |
| 95 | return LqnCorePackage.Literals.DOCUMENT_ROOT; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * <!-- begin-user-doc --> |
| 100 | * <!-- end-user-doc --> |
| 101 | * @generated |
| 102 | */ |
| 103 | public FeatureMap getMixed() { |
| 104 | if (mixed == null) { |
| 105 | mixed = new BasicFeatureMap(this, LqnCorePackage.DOCUMENT_ROOT__MIXED); |
| 106 | } |
| 107 | return mixed; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * <!-- begin-user-doc --> |
| 112 | * <!-- end-user-doc --> |
| 113 | * @generated |
| 114 | */ |
| 115 | public EMap<String, String> getXMLNSPrefixMap() { |
| 116 | if (xMLNSPrefixMap == null) { |
| 117 | xMLNSPrefixMap = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, LqnCorePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP); |
| 118 | } |
| 119 | return xMLNSPrefixMap; |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * <!-- begin-user-doc --> |
| 124 | * <!-- end-user-doc --> |
| 125 | * @generated |
| 126 | */ |
| 127 | public EMap<String, String> getXSISchemaLocation() { |
| 128 | if (xSISchemaLocation == null) { |
| 129 | xSISchemaLocation = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, LqnCorePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); |
| 130 | } |
| 131 | return xSISchemaLocation; |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * <!-- begin-user-doc --> |
| 136 | * <!-- end-user-doc --> |
| 137 | * @generated |
| 138 | */ |
| 139 | public LqnCoreType getLqnCore() { |
| 140 | return (LqnCoreType)getMixed().get(LqnCorePackage.Literals.DOCUMENT_ROOT__LQN_CORE, true); |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * <!-- begin-user-doc --> |
| 145 | * <!-- end-user-doc --> |
| 146 | * @generated |
| 147 | */ |
| 148 | public NotificationChain basicSetLqnCore(LqnCoreType newLqnCore, NotificationChain msgs) { |
| 149 | return ((FeatureMap.Internal)getMixed()).basicAdd(LqnCorePackage.Literals.DOCUMENT_ROOT__LQN_CORE, newLqnCore, msgs); |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * <!-- begin-user-doc --> |
| 154 | * <!-- end-user-doc --> |
| 155 | * @generated |
| 156 | */ |
| 157 | public void setLqnCore(LqnCoreType newLqnCore) { |
| 158 | ((FeatureMap.Internal)getMixed()).set(LqnCorePackage.Literals.DOCUMENT_ROOT__LQN_CORE, newLqnCore); |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * <!-- begin-user-doc --> |
| 163 | * <!-- end-user-doc --> |
| 164 | * @generated |
| 165 | */ |
| 166 | public LqnModelType getLqnModel() { |
| 167 | return (LqnModelType)getMixed().get(LqnCorePackage.Literals.DOCUMENT_ROOT__LQN_MODEL, true); |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * <!-- begin-user-doc --> |
| 172 | * <!-- end-user-doc --> |
| 173 | * @generated |
| 174 | */ |
| 175 | public NotificationChain basicSetLqnModel(LqnModelType newLqnModel, NotificationChain msgs) { |
| 176 | return ((FeatureMap.Internal)getMixed()).basicAdd(LqnCorePackage.Literals.DOCUMENT_ROOT__LQN_MODEL, newLqnModel, msgs); |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * <!-- begin-user-doc --> |
| 181 | * <!-- end-user-doc --> |
| 182 | * @generated |
| 183 | */ |
| 184 | public void setLqnModel(LqnModelType newLqnModel) { |
| 185 | ((FeatureMap.Internal)getMixed()).set(LqnCorePackage.Literals.DOCUMENT_ROOT__LQN_MODEL, newLqnModel); |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * <!-- begin-user-doc --> |
| 190 | * <!-- end-user-doc --> |
| 191 | * @generated |
| 192 | */ |
| 193 | @Override |
| 194 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 195 | switch (featureID) { |
| 196 | case LqnCorePackage.DOCUMENT_ROOT__MIXED: |
| 197 | return ((InternalEList<?>)getMixed()).basicRemove(otherEnd, msgs); |
| 198 | case LqnCorePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: |
| 199 | return ((InternalEList<?>)getXMLNSPrefixMap()).basicRemove(otherEnd, msgs); |
| 200 | case LqnCorePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: |
| 201 | return ((InternalEList<?>)getXSISchemaLocation()).basicRemove(otherEnd, msgs); |
| 202 | case LqnCorePackage.DOCUMENT_ROOT__LQN_CORE: |
| 203 | return basicSetLqnCore(null, msgs); |
| 204 | case LqnCorePackage.DOCUMENT_ROOT__LQN_MODEL: |
| 205 | return basicSetLqnModel(null, msgs); |
| 206 | } |
| 207 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * <!-- begin-user-doc --> |
| 212 | * <!-- end-user-doc --> |
| 213 | * @generated |
| 214 | */ |
| 215 | @Override |
| 216 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 217 | switch (featureID) { |
| 218 | case LqnCorePackage.DOCUMENT_ROOT__MIXED: |
| 219 | if (coreType) return getMixed(); |
| 220 | return ((FeatureMap.Internal)getMixed()).getWrapper(); |
| 221 | case LqnCorePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: |
| 222 | if (coreType) return getXMLNSPrefixMap(); |
| 223 | else return getXMLNSPrefixMap().map(); |
| 224 | case LqnCorePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: |
| 225 | if (coreType) return getXSISchemaLocation(); |
| 226 | else return getXSISchemaLocation().map(); |
| 227 | case LqnCorePackage.DOCUMENT_ROOT__LQN_CORE: |
| 228 | return getLqnCore(); |
| 229 | case LqnCorePackage.DOCUMENT_ROOT__LQN_MODEL: |
| 230 | return getLqnModel(); |
| 231 | } |
| 232 | return super.eGet(featureID, resolve, coreType); |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * <!-- begin-user-doc --> |
| 237 | * <!-- end-user-doc --> |
| 238 | * @generated |
| 239 | */ |
| 240 | @Override |
| 241 | public void eSet(int featureID, Object newValue) { |
| 242 | switch (featureID) { |
| 243 | case LqnCorePackage.DOCUMENT_ROOT__MIXED: |
| 244 | ((FeatureMap.Internal)getMixed()).set(newValue); |
| 245 | return; |
| 246 | case LqnCorePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: |
| 247 | ((EStructuralFeature.Setting)getXMLNSPrefixMap()).set(newValue); |
| 248 | return; |
| 249 | case LqnCorePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: |
| 250 | ((EStructuralFeature.Setting)getXSISchemaLocation()).set(newValue); |
| 251 | return; |
| 252 | case LqnCorePackage.DOCUMENT_ROOT__LQN_CORE: |
| 253 | setLqnCore((LqnCoreType)newValue); |
| 254 | return; |
| 255 | case LqnCorePackage.DOCUMENT_ROOT__LQN_MODEL: |
| 256 | setLqnModel((LqnModelType)newValue); |
| 257 | return; |
| 258 | } |
| 259 | super.eSet(featureID, newValue); |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * <!-- begin-user-doc --> |
| 264 | * <!-- end-user-doc --> |
| 265 | * @generated |
| 266 | */ |
| 267 | @Override |
| 268 | public void eUnset(int featureID) { |
| 269 | switch (featureID) { |
| 270 | case LqnCorePackage.DOCUMENT_ROOT__MIXED: |
| 271 | getMixed().clear(); |
| 272 | return; |
| 273 | case LqnCorePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: |
| 274 | getXMLNSPrefixMap().clear(); |
| 275 | return; |
| 276 | case LqnCorePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: |
| 277 | getXSISchemaLocation().clear(); |
| 278 | return; |
| 279 | case LqnCorePackage.DOCUMENT_ROOT__LQN_CORE: |
| 280 | setLqnCore((LqnCoreType)null); |
| 281 | return; |
| 282 | case LqnCorePackage.DOCUMENT_ROOT__LQN_MODEL: |
| 283 | setLqnModel((LqnModelType)null); |
| 284 | return; |
| 285 | } |
| 286 | super.eUnset(featureID); |
| 287 | } |
| 288 | |
| 289 | /** |
| 290 | * <!-- begin-user-doc --> |
| 291 | * <!-- end-user-doc --> |
| 292 | * @generated |
| 293 | */ |
| 294 | @Override |
| 295 | public boolean eIsSet(int featureID) { |
| 296 | switch (featureID) { |
| 297 | case LqnCorePackage.DOCUMENT_ROOT__MIXED: |
| 298 | return mixed != null && !mixed.isEmpty(); |
| 299 | case LqnCorePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP: |
| 300 | return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty(); |
| 301 | case LqnCorePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION: |
| 302 | return xSISchemaLocation != null && !xSISchemaLocation.isEmpty(); |
| 303 | case LqnCorePackage.DOCUMENT_ROOT__LQN_CORE: |
| 304 | return getLqnCore() != null; |
| 305 | case LqnCorePackage.DOCUMENT_ROOT__LQN_MODEL: |
| 306 | return getLqnModel() != null; |
| 307 | } |
| 308 | return super.eIsSet(featureID); |
| 309 | } |
| 310 | |
| 311 | /** |
| 312 | * <!-- begin-user-doc --> |
| 313 | * <!-- end-user-doc --> |
| 314 | * @generated |
| 315 | */ |
| 316 | @Override |
| 317 | public String toString() { |
| 318 | if (eIsProxy()) return super.toString(); |
| 319 | |
| 320 | StringBuffer result = new StringBuffer(super.toString()); |
| 321 | result.append(" (mixed: "); |
| 322 | result.append(mixed); |
| 323 | result.append(')'); |
| 324 | return result.toString(); |
| 325 | } |
| 326 | |
| 327 | } //DocumentRootImpl |