1 17 package org.eclipse.emf.mapping.ecore2xml.util; 18 19 import java.util.Map ; 20 21 import org.eclipse.emf.common.notify.Adapter; 22 import org.eclipse.emf.common.notify.Notifier; 23 24 import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; 25 26 import org.eclipse.emf.ecore.EObject; 27 import org.eclipse.emf.mapping.ecore2xml.*; 28 29 37 public class Ecore2XMLAdapterFactory extends AdapterFactoryImpl 38 { 39 40 46 protected static Ecore2XMLPackage modelPackage; 47 48 54 public Ecore2XMLAdapterFactory() 55 { 56 if (modelPackage == null) 57 { 58 modelPackage = Ecore2XMLPackage.eINSTANCE; 59 } 60 } 61 62 70 public boolean isFactoryForType(Object object) 71 { 72 if (object == modelPackage) 73 { 74 return true; 75 } 76 if (object instanceof EObject) 77 { 78 return ((EObject)object).eClass().getEPackage() == modelPackage; 79 } 80 return false; 81 } 82 83 89 protected Ecore2XMLSwitch modelSwitch = 90 new Ecore2XMLSwitch() 91 { 92 public Object caseXMLInfo(XMLInfo object) 93 { 94 return createXMLInfoAdapter(); 95 } 96 public Object caseXMLMap(XMLMap object) 97 { 98 return createXMLMapAdapter(); 99 } 100 public Object caseENamedElementToXMLInfoMapEntry(Map.Entry object) 101 { 102 return createENamedElementToXMLInfoMapEntryAdapter(); 103 } 104 public Object defaultCase(EObject object) 105 { 106 return createEObjectAdapter(); 107 } 108 }; 109 110 118 public Adapter createAdapter(Notifier target) 119 { 120 return (Adapter)modelSwitch.doSwitch((EObject)target); 121 } 122 123 124 134 public Adapter createXMLInfoAdapter() 135 { 136 return null; 137 } 138 139 149 public Adapter createXMLMapAdapter() 150 { 151 return null; 152 } 153 154 164 public Adapter createENamedElementToXMLInfoMapEntryAdapter() 165 { 166 return null; 167 } 168 169 177 public Adapter createEObjectAdapter() 178 { 179 return null; 180 } 181 182 } | Popular Tags |