1 17 package org.eclipse.emf.ecore.util; 18 19 20 import java.util.Map ; 21 22 import org.eclipse.emf.common.notify.Adapter; 23 import org.eclipse.emf.common.notify.Notifier; 24 import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; 25 import org.eclipse.emf.ecore.*; 26 import org.eclipse.emf.ecore.EObject; 27 28 29 37 public class EcoreAdapterFactory extends AdapterFactoryImpl 38 { 39 45 protected static EcorePackage modelPackage; 46 47 53 public EcoreAdapterFactory() 54 { 55 if (modelPackage == null) 56 { 57 modelPackage = EcorePackage.eINSTANCE; 58 } 59 } 60 61 69 public boolean isFactoryForType(Object object) 70 { 71 if (object == modelPackage) 72 { 73 return true; 74 } 75 if (object instanceof EObject) 76 { 77 return ((EObject)object).eClass().getEPackage() == modelPackage; 78 } 79 return false; 80 } 81 82 88 protected EcoreSwitch modelSwitch = 89 new EcoreSwitch() 90 { 91 public Object caseEAttribute(EAttribute object) 92 { 93 return createEAttributeAdapter(); 94 } 95 public Object caseEAnnotation(EAnnotation object) 96 { 97 return createEAnnotationAdapter(); 98 } 99 public Object caseEClass(EClass object) 100 { 101 return createEClassAdapter(); 102 } 103 public Object caseEClassifier(EClassifier object) 104 { 105 return createEClassifierAdapter(); 106 } 107 public Object caseEDataType(EDataType object) 108 { 109 return createEDataTypeAdapter(); 110 } 111 public Object caseEEnum(EEnum object) 112 { 113 return createEEnumAdapter(); 114 } 115 public Object caseEEnumLiteral(EEnumLiteral object) 116 { 117 return createEEnumLiteralAdapter(); 118 } 119 public Object caseEFactory(EFactory object) 120 { 121 return createEFactoryAdapter(); 122 } 123 public Object caseEModelElement(EModelElement object) 124 { 125 return createEModelElementAdapter(); 126 } 127 public Object caseENamedElement(ENamedElement object) 128 { 129 return createENamedElementAdapter(); 130 } 131 public Object caseEOperation(EOperation object) 132 { 133 return createEOperationAdapter(); 134 } 135 public Object caseEPackage(EPackage object) 136 { 137 return createEPackageAdapter(); 138 } 139 public Object caseEParameter(EParameter object) 140 { 141 return createEParameterAdapter(); 142 } 143 public Object caseEReference(EReference object) 144 { 145 return createEReferenceAdapter(); 146 } 147 public Object caseEStructuralFeature(EStructuralFeature object) 148 { 149 return createEStructuralFeatureAdapter(); 150 } 151 public Object caseETypedElement(ETypedElement object) 152 { 153 return createETypedElementAdapter(); 154 } 155 public Object caseEStringToStringMapEntry(Map.Entry object) 156 { 157 return createEStringToStringMapEntryAdapter(); 158 } 159 public Object defaultCase(EObject object) 160 { 161 return createEObjectAdapter(); 162 } 163 }; 164 165 173 public Adapter createAdapter(Notifier target) 174 { 175 return (Adapter)modelSwitch.doSwitch((EObject)target); 176 } 177 178 179 189 public Adapter createEModelElementAdapter() 190 { 191 return null; 192 } 193 194 204 public Adapter createEStructuralFeatureAdapter() 205 { 206 return null; 207 } 208 209 219 public Adapter createEAnnotationAdapter() 220 { 221 return null; 222 } 223 224 234 public Adapter createEAttributeAdapter() 235 { 236 return null; 237 } 238 239 249 public Adapter createEClassAdapter() 250 { 251 return null; 252 } 253 254 264 public Adapter createEDataTypeAdapter() 265 { 266 return null; 267 } 268 269 279 public Adapter createEClassifierAdapter() 280 { 281 return null; 282 } 283 284 294 public Adapter createENamedElementAdapter() 295 { 296 return null; 297 } 298 299 309 public Adapter createETypedElementAdapter() 310 { 311 return null; 312 } 313 314 324 public Adapter createEParameterAdapter() 325 { 326 return null; 327 } 328 329 339 public Adapter createEOperationAdapter() 340 { 341 return null; 342 } 343 344 354 public Adapter createEPackageAdapter() 355 { 356 return null; 357 } 358 359 369 public Adapter createEFactoryAdapter() 370 { 371 return null; 372 } 373 374 384 public Adapter createEEnumLiteralAdapter() 385 { 386 return null; 387 } 388 389 399 public Adapter createEEnumAdapter() 400 { 401 return null; 402 } 403 404 414 public Adapter createEReferenceAdapter() 415 { 416 return null; 417 } 418 419 429 public Adapter createEStringToStringMapEntryAdapter() 430 { 431 return null; 432 } 433 434 442 public Adapter createEObjectAdapter() 443 { 444 return null; 445 } 446 447 } | Popular Tags |