| /********************************************************************* |
| * 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.eol; |
| |
| import org.eclipse.epsilon.executors.EpsilonLanguageExecutor; |
| import java.util.List; |
| |
| /** |
| * The IEolExecutor API provides additional methods to invoke a single operation inside an EOL |
| * script. The desired operation can be set using {@link #setOperationName(String)} and any |
| * required parameters for the operation passed via {@link #setOperationArguments(List)}. Setting |
| * the operation name with a non-empty string will set the execution mode to {@link EolMode#OPERATION}. |
| * Executing in {@link EolMode#OPERATION} without previously setting the operation name |
| * (via {@link #setOperationName(String)} will result in an {@link EolRuntimeException}. |
| * |
| * Setting the operation name to an empty string will result in the execution mode to change to |
| * {@link EolMode#SCRIPT}. Alternatively the {@link #setMode(EolMode)} method can be used to |
| * change the execution mode. |
| * |
| * @author Horacio Hoyos Rodriguez |
| * |
| */ |
| public interface EolExecutor extends EpsilonLanguageExecutor<Object> { |
| |
| public static enum EolMode { |
| SCRIPT, |
| OPERATION |
| } |
| |
| /** |
| * Set the operation name to invoke and any parameters to pass to the operation being invoked. |
| * @param arguments |
| */ |
| SimpleEolExecutor changeOperation(String operationName, List<Object> arguments); |
| |
| /** |
| * Set the operation name to invoke. This method can be used for operations with no parameters. |
| * @param arguments |
| */ |
| SimpleEolExecutor changeOperation(String operationName); |
| |
| } |