| /********************************************************************* |
| * 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.IEpsilonLanguageExecutor; |
| 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#COMPLETE}. Alternatively the {@link #setMode(EolMode)} method can be used to |
| * change the execution mode. |
| * |
| * @author Horacio Hoyos Rodriguez |
| * |
| */ |
| public interface IEolExecutor extends IEpsilonLanguageExecutor { |
| |
| public static enum EolMode { |
| COMPLETE, |
| OPERATION |
| } |
| |
| /** |
| * Set the operation name to invoke. Arguments to invoke the operation |
| * can be provided via {@link #setOperationArguments(List)} |
| * |
| * @param operationName the operation name |
| */ |
| void setOperationName(String operationName); |
| |
| /** |
| * Set any parameters to pass to the operation being invoked. The operation |
| * |
| * @param arguments |
| */ |
| void setOperationArguments(List<Object> arguments); |
| |
| /** |
| * Set the executor to "complete script mode", where the whole script as opposed to a single |
| * operation is run. |
| * <p> |
| * If the mode is set to {@link EolMode#OPERATION} and no operation name has been set |
| */ |
| void setMode(EolMode mode); |
| |
| } |