| /********************************************************************* |
| * Copyright (c) 2019 The University of York. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| **********************************************************************/ |
| package org.eclipse.epsilon.executors; |
| |
| import org.eclipse.epsilon.executors.ecl.SimpleEclExecutor; |
| import org.eclipse.epsilon.executors.egl.SimpleEglExecutor; |
| import org.eclipse.epsilon.executors.egl.SimpleEgxExecutor; |
| import org.eclipse.epsilon.executors.eol.SimpleEolExecutor; |
| import org.eclipse.epsilon.executors.etl.SimpleEtlExecutor; |
| import org.eclipse.epsilon.executors.evl.SimpleEvlExecutor; |
| |
| |
| /** |
| * A factory for the different executors. |
| * |
| * @author Horacio Hoyos Rodriguez |
| */ |
| @Deprecated |
| public class EpsilonEngineExecutorFactory { |
| |
| @SuppressWarnings("unchecked") |
| public <E extends EpsilonLanguageExecutor> E getExecutor(String engineName) { |
| |
| switch (engineName.substring(0, 3).toUpperCase()) { |
| case "ECL": |
| return (E) new SimpleEclExecutor(); |
| case "EGL": |
| return (E) new SimpleEglExecutor(); |
| case "EGX": |
| return (E) new SimpleEgxExecutor(); |
| case "EOL": |
| return (E) new SimpleEolExecutor(); |
| case "ETL": |
| return (E) new SimpleEtlExecutor(); |
| case "EVL": |
| return (E) new SimpleEvlExecutor(); |
| default: |
| return null; |
| } |
| } |
| |
| } |