/edu.ustb.sei.mt4mt.model/src/edu/ustb/sei/mde/mt4mt/impl/MT4MTFactoryImpl.java

https://bitbucket.org/ustbmde/model-generation · Java · 434 lines · 202 code · 41 blank · 191 comment · 8 complexity · a8030df75e4de93643be1421f57f150b MD5 · raw file

  1. /**
  2. */
  3. package edu.ustb.sei.mde.mt4mt.impl;
  4. import edu.ustb.sei.mde.mt4mt.*;
  5. import edu.ustb.sei.mt4mt.base.IAction;
  6. import edu.ustb.sei.mt4mt.base.test.AbstractTransformationTestCase;
  7. import org.eclipse.emf.ecore.EClass;
  8. import org.eclipse.emf.ecore.EDataType;
  9. import org.eclipse.emf.ecore.EObject;
  10. import org.eclipse.emf.ecore.EPackage;
  11. import org.eclipse.emf.ecore.impl.EFactoryImpl;
  12. import org.eclipse.emf.ecore.plugin.EcorePlugin;
  13. /**
  14. * <!-- begin-user-doc -->
  15. * An implementation of the model <b>Factory</b>.
  16. * <!-- end-user-doc -->
  17. * @generated
  18. */
  19. public class MT4MTFactoryImpl extends EFactoryImpl implements MT4MTFactory {
  20. /**
  21. * Creates the default factory implementation.
  22. * <!-- begin-user-doc -->
  23. * <!-- end-user-doc -->
  24. * @generated
  25. */
  26. public static MT4MTFactory init() {
  27. try {
  28. MT4MTFactory theMT4MTFactory = (MT4MTFactory)EPackage.Registry.INSTANCE.getEFactory(MT4MTPackage.eNS_URI);
  29. if (theMT4MTFactory != null) {
  30. return theMT4MTFactory;
  31. }
  32. }
  33. catch (Exception exception) {
  34. EcorePlugin.INSTANCE.log(exception);
  35. }
  36. return new MT4MTFactoryImpl();
  37. }
  38. /**
  39. * Creates an instance of the factory.
  40. * <!-- begin-user-doc -->
  41. * <!-- end-user-doc -->
  42. * @generated
  43. */
  44. public MT4MTFactoryImpl() {
  45. super();
  46. }
  47. /**
  48. * <!-- begin-user-doc -->
  49. * <!-- end-user-doc -->
  50. * @generated
  51. */
  52. @Override
  53. public EObject create(EClass eClass) {
  54. switch (eClass.getClassifierID()) {
  55. case MT4MTPackage.TEST_SUITE: return createTestSuite();
  56. case MT4MTPackage.CUSTOMIZABLE_TEST_CASE: return createCustomizableTestCase();
  57. case MT4MTPackage.GET_PUT_TEST_CASE: return createGetPutTestCase();
  58. case MT4MTPackage.PUT_GET_TEST_CASE: return createPutGetTestCase();
  59. case MT4MTPackage.SEQUENCE_ACTION: return createSequenceAction();
  60. case MT4MTPackage.LOAD_MODEL_ACTION: return createLoadModelAction();
  61. case MT4MTPackage.SAVE_MODEL_ACTION: return createSaveModelAction();
  62. case MT4MTPackage.EXECUTE_LAUNCHER_ACTION: return createExecuteLauncherAction();
  63. case MT4MTPackage.EVALUATE_OCL_QUERY_ACTION: return createEvaluateOCLQueryAction();
  64. case MT4MTPackage.COPY_MODEL_ACTION: return createCopyModelAction();
  65. case MT4MTPackage.COMPARE_MODEL_ACTION: return createCompareModelAction();
  66. case MT4MTPackage.ASSERT_COMPARISON_RESULT_ACTION: return createAssertComparisonResultAction();
  67. case MT4MTPackage.ASSERT_OCL_INVARIANT_ACTION: return createAssertOCLInvariantAction();
  68. case MT4MTPackage.USER_ACTION: return createUserAction();
  69. case MT4MTPackage.SET_VARIABLE_ACTION: return createSetVariableAction();
  70. case MT4MTPackage.UPDATE_MODEL_ACTION: return createUpdateModelAction();
  71. case MT4MTPackage.WRAPPER_TEST_CASE: return createWrapperTestCase();
  72. case MT4MTPackage.AUTO_EXECUTOR_TEST_SUITE: return createAutoExecutorTestSuite();
  73. case MT4MTPackage.CLEAR_ACTION: return createClearAction();
  74. case MT4MTPackage.EXTERNAL_ACTION: return createExternalAction();
  75. case MT4MTPackage.EXTERNAL_ACTION_PARAMETER: return createExternalActionParameter();
  76. default:
  77. throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
  78. }
  79. }
  80. /**
  81. * <!-- begin-user-doc -->
  82. * <!-- end-user-doc -->
  83. * @generated
  84. */
  85. @Override
  86. public Object createFromString(EDataType eDataType, String initialValue) {
  87. switch (eDataType.getClassifierID()) {
  88. case MT4MTPackage.DIFF_KIND:
  89. return createDiffKindFromString(eDataType, initialValue);
  90. case MT4MTPackage.IACTION:
  91. return createIActionFromString(eDataType, initialValue);
  92. case MT4MTPackage.ABSTRACT_TRANSFORMATION_TEST_CASE:
  93. return createAbstractTransformationTestCaseFromString(eDataType, initialValue);
  94. case MT4MTPackage.IEXTERNAL_ACTION:
  95. return createIExternalActionFromString(eDataType, initialValue);
  96. default:
  97. throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
  98. }
  99. }
  100. /**
  101. * <!-- begin-user-doc -->
  102. * <!-- end-user-doc -->
  103. * @generated
  104. */
  105. @Override
  106. public String convertToString(EDataType eDataType, Object instanceValue) {
  107. switch (eDataType.getClassifierID()) {
  108. case MT4MTPackage.DIFF_KIND:
  109. return convertDiffKindToString(eDataType, instanceValue);
  110. case MT4MTPackage.IACTION:
  111. return convertIActionToString(eDataType, instanceValue);
  112. case MT4MTPackage.ABSTRACT_TRANSFORMATION_TEST_CASE:
  113. return convertAbstractTransformationTestCaseToString(eDataType, instanceValue);
  114. case MT4MTPackage.IEXTERNAL_ACTION:
  115. return convertIExternalActionToString(eDataType, instanceValue);
  116. default:
  117. throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
  118. }
  119. }
  120. /**
  121. * <!-- begin-user-doc -->
  122. * <!-- end-user-doc -->
  123. * @generated
  124. */
  125. public TestSuite createTestSuite() {
  126. TestSuiteImpl testSuite = new TestSuiteImpl();
  127. return testSuite;
  128. }
  129. /**
  130. * <!-- begin-user-doc -->
  131. * <!-- end-user-doc -->
  132. * @generated
  133. */
  134. public CustomizableTestCase createCustomizableTestCase() {
  135. CustomizableTestCaseImpl customizableTestCase = new CustomizableTestCaseImpl();
  136. return customizableTestCase;
  137. }
  138. /**
  139. * <!-- begin-user-doc -->
  140. * <!-- end-user-doc -->
  141. * @generated
  142. */
  143. public GetPutTestCase createGetPutTestCase() {
  144. GetPutTestCaseImpl getPutTestCase = new GetPutTestCaseImpl();
  145. return getPutTestCase;
  146. }
  147. /**
  148. * <!-- begin-user-doc -->
  149. * <!-- end-user-doc -->
  150. * @generated
  151. */
  152. public PutGetTestCase createPutGetTestCase() {
  153. PutGetTestCaseImpl putGetTestCase = new PutGetTestCaseImpl();
  154. return putGetTestCase;
  155. }
  156. /**
  157. * <!-- begin-user-doc -->
  158. * <!-- end-user-doc -->
  159. * @generated
  160. */
  161. public SequenceAction createSequenceAction() {
  162. SequenceActionImpl sequenceAction = new SequenceActionImpl();
  163. return sequenceAction;
  164. }
  165. /**
  166. * <!-- begin-user-doc -->
  167. * <!-- end-user-doc -->
  168. * @generated
  169. */
  170. public LoadModelAction createLoadModelAction() {
  171. LoadModelActionImpl loadModelAction = new LoadModelActionImpl();
  172. return loadModelAction;
  173. }
  174. /**
  175. * <!-- begin-user-doc -->
  176. * <!-- end-user-doc -->
  177. * @generated
  178. */
  179. public SaveModelAction createSaveModelAction() {
  180. SaveModelActionImpl saveModelAction = new SaveModelActionImpl();
  181. return saveModelAction;
  182. }
  183. /**
  184. * <!-- begin-user-doc -->
  185. * <!-- end-user-doc -->
  186. * @generated
  187. */
  188. public ExecuteLauncherAction createExecuteLauncherAction() {
  189. ExecuteLauncherActionImpl executeLauncherAction = new ExecuteLauncherActionImpl();
  190. return executeLauncherAction;
  191. }
  192. /**
  193. * <!-- begin-user-doc -->
  194. * <!-- end-user-doc -->
  195. * @generated
  196. */
  197. public EvaluateOCLQueryAction createEvaluateOCLQueryAction() {
  198. EvaluateOCLQueryActionImpl evaluateOCLQueryAction = new EvaluateOCLQueryActionImpl();
  199. return evaluateOCLQueryAction;
  200. }
  201. /**
  202. * <!-- begin-user-doc -->
  203. * <!-- end-user-doc -->
  204. * @generated
  205. */
  206. public CopyModelAction createCopyModelAction() {
  207. CopyModelActionImpl copyModelAction = new CopyModelActionImpl();
  208. return copyModelAction;
  209. }
  210. /**
  211. * <!-- begin-user-doc -->
  212. * <!-- end-user-doc -->
  213. * @generated
  214. */
  215. public CompareModelAction createCompareModelAction() {
  216. CompareModelActionImpl compareModelAction = new CompareModelActionImpl();
  217. return compareModelAction;
  218. }
  219. /**
  220. * <!-- begin-user-doc -->
  221. * <!-- end-user-doc -->
  222. * @generated
  223. */
  224. public AssertComparisonResultAction createAssertComparisonResultAction() {
  225. AssertComparisonResultActionImpl assertComparisonResultAction = new AssertComparisonResultActionImpl();
  226. return assertComparisonResultAction;
  227. }
  228. /**
  229. * <!-- begin-user-doc -->
  230. * <!-- end-user-doc -->
  231. * @generated
  232. */
  233. public AssertOCLInvariantAction createAssertOCLInvariantAction() {
  234. AssertOCLInvariantActionImpl assertOCLInvariantAction = new AssertOCLInvariantActionImpl();
  235. return assertOCLInvariantAction;
  236. }
  237. /**
  238. * <!-- begin-user-doc -->
  239. * <!-- end-user-doc -->
  240. * @generated
  241. */
  242. public UserAction createUserAction() {
  243. UserActionImpl userAction = new UserActionImpl();
  244. return userAction;
  245. }
  246. /**
  247. * <!-- begin-user-doc -->
  248. * <!-- end-user-doc -->
  249. * @generated
  250. */
  251. public SetVariableAction createSetVariableAction() {
  252. SetVariableActionImpl setVariableAction = new SetVariableActionImpl();
  253. return setVariableAction;
  254. }
  255. /**
  256. * <!-- begin-user-doc -->
  257. * <!-- end-user-doc -->
  258. * @generated
  259. */
  260. public UpdateModelAction createUpdateModelAction() {
  261. UpdateModelActionImpl updateModelAction = new UpdateModelActionImpl();
  262. return updateModelAction;
  263. }
  264. /**
  265. * <!-- begin-user-doc -->
  266. * <!-- end-user-doc -->
  267. * @generated
  268. */
  269. public WrapperTestCase createWrapperTestCase() {
  270. WrapperTestCaseImpl wrapperTestCase = new WrapperTestCaseImpl();
  271. return wrapperTestCase;
  272. }
  273. /**
  274. * <!-- begin-user-doc -->
  275. * <!-- end-user-doc -->
  276. * @generated
  277. */
  278. public AutoExecutorTestSuite createAutoExecutorTestSuite() {
  279. AutoExecutorTestSuiteImpl autoExecutorTestSuite = new AutoExecutorTestSuiteImpl();
  280. return autoExecutorTestSuite;
  281. }
  282. /**
  283. * <!-- begin-user-doc -->
  284. * <!-- end-user-doc -->
  285. * @generated
  286. */
  287. public ClearAction createClearAction() {
  288. ClearActionImpl clearAction = new ClearActionImpl();
  289. return clearAction;
  290. }
  291. /**
  292. * <!-- begin-user-doc -->
  293. * <!-- end-user-doc -->
  294. * @generated
  295. */
  296. public ExternalAction createExternalAction() {
  297. ExternalActionImpl externalAction = new ExternalActionImpl();
  298. return externalAction;
  299. }
  300. /**
  301. * <!-- begin-user-doc -->
  302. * <!-- end-user-doc -->
  303. * @generated
  304. */
  305. public ExternalActionParameter createExternalActionParameter() {
  306. ExternalActionParameterImpl externalActionParameter = new ExternalActionParameterImpl();
  307. return externalActionParameter;
  308. }
  309. /**
  310. * <!-- begin-user-doc -->
  311. * <!-- end-user-doc -->
  312. * @generated
  313. */
  314. public DiffKind createDiffKindFromString(EDataType eDataType, String initialValue) {
  315. DiffKind result = DiffKind.get(initialValue);
  316. if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
  317. return result;
  318. }
  319. /**
  320. * <!-- begin-user-doc -->
  321. * <!-- end-user-doc -->
  322. * @generated
  323. */
  324. public String convertDiffKindToString(EDataType eDataType, Object instanceValue) {
  325. return instanceValue == null ? null : instanceValue.toString();
  326. }
  327. /**
  328. * <!-- begin-user-doc -->
  329. * <!-- end-user-doc -->
  330. * @generated
  331. */
  332. public IAction createIActionFromString(EDataType eDataType, String initialValue) {
  333. return (IAction)super.createFromString(eDataType, initialValue);
  334. }
  335. /**
  336. * <!-- begin-user-doc -->
  337. * <!-- end-user-doc -->
  338. * @generated
  339. */
  340. public String convertIActionToString(EDataType eDataType, Object instanceValue) {
  341. return super.convertToString(eDataType, instanceValue);
  342. }
  343. /**
  344. * <!-- begin-user-doc -->
  345. * <!-- end-user-doc -->
  346. * @generated
  347. */
  348. public AbstractTransformationTestCase createAbstractTransformationTestCaseFromString(EDataType eDataType, String initialValue) {
  349. return (AbstractTransformationTestCase)super.createFromString(eDataType, initialValue);
  350. }
  351. /**
  352. * <!-- begin-user-doc -->
  353. * <!-- end-user-doc -->
  354. * @generated
  355. */
  356. public String convertAbstractTransformationTestCaseToString(EDataType eDataType, Object instanceValue) {
  357. return super.convertToString(eDataType, instanceValue);
  358. }
  359. /**
  360. * <!-- begin-user-doc -->
  361. * <!-- end-user-doc -->
  362. * @generated
  363. */
  364. public edu.ustb.sei.mt4mt.base.updates.IExternalAction createIExternalActionFromString(EDataType eDataType, String initialValue) {
  365. return (edu.ustb.sei.mt4mt.base.updates.IExternalAction)super.createFromString(eDataType, initialValue);
  366. }
  367. /**
  368. * <!-- begin-user-doc -->
  369. * <!-- end-user-doc -->
  370. * @generated
  371. */
  372. public String convertIExternalActionToString(EDataType eDataType, Object instanceValue) {
  373. return super.convertToString(eDataType, instanceValue);
  374. }
  375. /**
  376. * <!-- begin-user-doc -->
  377. * <!-- end-user-doc -->
  378. * @generated
  379. */
  380. public MT4MTPackage getMT4MTPackage() {
  381. return (MT4MTPackage)getEPackage();
  382. }
  383. /**
  384. * <!-- begin-user-doc -->
  385. * <!-- end-user-doc -->
  386. * @deprecated
  387. * @generated
  388. */
  389. @Deprecated
  390. public static MT4MTPackage getPackage() {
  391. return MT4MTPackage.eINSTANCE;
  392. }
  393. } //MT4MTFactoryImpl