1 17 package org.eclipse.emf.mapping.ecore2ecore.util; 18 19 20 import org.eclipse.emf.common.notify.Adapter; 21 import org.eclipse.emf.common.notify.Notifier; 22 23 import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; 24 25 import org.eclipse.emf.ecore.EObject; 26 27 import org.eclipse.emf.mapping.Mapping; 28 import org.eclipse.emf.mapping.MappingRoot; 29 30 import org.eclipse.emf.mapping.ecore2ecore.*; 31 32 33 41 public class Ecore2EcoreAdapterFactory extends AdapterFactoryImpl 42 { 43 49 protected static Ecore2EcorePackage modelPackage; 50 51 57 public Ecore2EcoreAdapterFactory() 58 { 59 if (modelPackage == null) 60 { 61 modelPackage = Ecore2EcorePackage.eINSTANCE; 62 } 63 } 64 65 73 public boolean isFactoryForType(Object object) 74 { 75 if (object == modelPackage) 76 { 77 return true; 78 } 79 if (object instanceof EObject) 80 { 81 return ((EObject)object).eClass().getEPackage() == modelPackage; 82 } 83 return false; 84 } 85 86 92 protected Ecore2EcoreSwitch modelSwitch = 93 new Ecore2EcoreSwitch() 94 { 95 public Object caseEcore2EcoreMappingRoot(Ecore2EcoreMappingRoot object) 96 { 97 return createEcore2EcoreMappingRootAdapter(); 98 } 99 public Object caseMapping(Mapping object) 100 { 101 return createMappingAdapter(); 102 } 103 public Object caseMappingRoot(MappingRoot object) 104 { 105 return createMappingRootAdapter(); 106 } 107 public Object defaultCase(EObject object) 108 { 109 return createEObjectAdapter(); 110 } 111 }; 112 113 121 public Adapter createAdapter(Notifier target) 122 { 123 return (Adapter)modelSwitch.doSwitch((EObject)target); 124 } 125 126 127 137 public Adapter createEcore2EcoreMappingRootAdapter() 138 { 139 return null; 140 } 141 142 152 public Adapter createMappingAdapter() 153 { 154 return null; 155 } 156 157 167 public Adapter createMappingRootAdapter() 168 { 169 return null; 170 } 171 172 180 public Adapter createEObjectAdapter() 181 { 182 return null; 183 } 184 185 } | Popular Tags |