1 17 package org.eclipse.emf.mapping.ecore2xml.impl; 18 19 20 import java.util.Map ; 21 22 import org.eclipse.emf.ecore.EClass; 23 import org.eclipse.emf.ecore.EObject; 24 25 import org.eclipse.emf.ecore.impl.EFactoryImpl; 26 import org.eclipse.emf.mapping.ecore2xml.*; 27 28 34 public class Ecore2XMLFactoryImpl extends EFactoryImpl implements Ecore2XMLFactory 35 { 36 37 43 public Ecore2XMLFactoryImpl() 44 { 45 super(); 46 } 47 48 53 public EObject create(EClass eClass) 54 { 55 switch (eClass.getClassifierID()) 56 { 57 case Ecore2XMLPackage.XML_INFO: return createXMLInfo(); 58 case Ecore2XMLPackage.XML_MAP: return createXMLMap(); 59 case Ecore2XMLPackage.ENAMED_ELEMENT_TO_XML_INFO_MAP_ENTRY: return (EObject)createENamedElementToXMLInfoMapEntry(); 60 default: 61 throw new IllegalArgumentException ("The class '" + eClass.getName() + "' is not a valid classifier"); } 63 } 64 65 70 public XMLInfo createXMLInfo() 71 { 72 XMLInfoImpl xmlInfo = new XMLInfoImpl(); 73 return xmlInfo; 74 } 75 76 81 public XMLMap createXMLMap() 82 { 83 XMLMapImpl xmlMap = new XMLMapImpl(); 84 return xmlMap; 85 } 86 87 92 public Map.Entry createENamedElementToXMLInfoMapEntry() 93 { 94 ENamedElementToXMLInfoMapEntryImpl eNamedElementToXMLInfoMapEntry = new ENamedElementToXMLInfoMapEntryImpl(); 95 return eNamedElementToXMLInfoMapEntry; 96 } 97 98 103 public Ecore2XMLPackage getEcore2XMLPackage() 104 { 105 return (Ecore2XMLPackage)getEPackage(); 106 } 107 108 114 public static Ecore2XMLPackage getPackage() 115 { 116 return Ecore2XMLPackage.eINSTANCE; 117 } 118 119 } | Popular Tags |