1 17 package org.eclipse.emf.ecore.sdo.impl; 18 19 20 import org.eclipse.emf.ecore.EClass; 21 import org.eclipse.emf.ecore.EDataType; 22 import org.eclipse.emf.ecore.EObject; 23 import org.eclipse.emf.ecore.EStructuralFeature; 24 import org.eclipse.emf.ecore.impl.EFactoryImpl; 25 import org.eclipse.emf.ecore.sdo.*; 26 27 28 34 public class SDOFactoryImpl extends EFactoryImpl implements SDOFactory 35 { 36 42 public SDOFactoryImpl() 43 { 44 super(); 45 } 46 47 52 public EObject create(EClass eClass) 53 { 54 switch (eClass.getClassifierID()) 55 { 56 case SDOPackage.ECHANGE_SUMMARY: return createEChangeSummary(); 57 case SDOPackage.ECHANGE_SUMMARY_SETTING: return createEChangeSummarySetting(); 58 case SDOPackage.EDATA_GRAPH: return createEDataGraph(); 59 case SDOPackage.EDATA_OBJECT: return createEDataObject(); 60 case SDOPackage.EPROPERTY: return createEProperty(); 61 case SDOPackage.ETYPE: return createEType(); 62 case SDOPackage.EDATA_OBJECT_ANY_TYPE: return createEDataObjectAnyType(); 63 case SDOPackage.EDATA_OBJECT_SIMPLE_ANY_TYPE: return createEDataObjectSimpleAnyType(); 64 default: 65 throw new IllegalArgumentException ("The class '" + eClass.getName() + "' is not a valid classifier"); 66 } 67 } 68 69 74 public Object createFromString(EDataType eDataType, String initialValue) 75 { 76 switch (eDataType.getClassifierID()) 77 { 78 default: 79 throw new IllegalArgumentException ("The datatype '" + eDataType.getName() + "' is not a valid classifier"); 80 } 81 } 82 83 88 public String convertToString(EDataType eDataType, Object instanceValue) 89 { 90 switch (eDataType.getClassifierID()) 91 { 92 default: 93 throw new IllegalArgumentException ("The datatype '" + eDataType.getName() + "' is not a valid classifier"); 94 } 95 } 96 97 102 public EDataObject createEDataObject() 103 { 104 EDataObjectImpl eDataObject = new EDataObjectImpl(); 105 return eDataObject; 106 } 107 108 113 public EDataGraph createEDataGraph() 114 { 115 EDataGraphImpl eDataGraph = new EDataGraphImpl(); 116 return eDataGraph; 117 } 118 119 124 public EChangeSummary createEChangeSummary() 125 { 126 EChangeSummaryImpl eChangeSummary = new EChangeSummaryImpl(); 127 return eChangeSummary; 128 } 129 130 135 public EProperty createEProperty() 136 { 137 EPropertyImpl eProperty = new EPropertyImpl(); 138 return eProperty; 139 } 140 141 146 public EType createEType() 147 { 148 ETypeImpl eType = new ETypeImpl(); 149 return eType; 150 } 151 152 157 public EDataObjectAnyType createEDataObjectAnyType() 158 { 159 EDataObjectAnyTypeImpl eDataObjectAnyType = new EDataObjectAnyTypeImpl(); 160 return eDataObjectAnyType; 161 } 162 163 168 public EDataObjectSimpleAnyType createEDataObjectSimpleAnyType() 169 { 170 EDataObjectSimpleAnyTypeImpl eDataObjectSimpleAnyType = new EDataObjectSimpleAnyTypeImpl(); 171 return eDataObjectSimpleAnyType; 172 } 173 174 179 public EChangeSummarySetting createEChangeSummarySetting() 180 { 181 EChangeSummarySettingImpl eChangeSummarySetting = new EChangeSummarySettingImpl(); 182 return eChangeSummarySetting; 183 } 184 185 190 public SDOPackage getSDOPackage() 191 { 192 return (SDOPackage)getEPackage(); 193 } 194 195 201 public static SDOPackage getPackage() 202 { 203 return SDOPackage.eINSTANCE; 204 } 205 206 public EChangeSummarySetting createEChangeSummarySetting(EStructuralFeature eStructuralFeature, Object value, boolean isSet) 207 { 208 EChangeSummarySettingImpl eChangeSummarySetting = new EChangeSummarySettingImpl(eStructuralFeature, value, isSet); 209 return eChangeSummarySetting; 210 } 211 212 } | Popular Tags |