From f39ab43fc0120b7fa97028d40acd7851de8d4a99 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Thu, 24 Nov 2022 14:14:37 +0100 Subject: Repository moved to GitHub: https://github.com/a-sit/pdf-over --- .../at/asit/pdfover/gui/cliarguments/Argument.java | 127 --------------------- 1 file changed, 127 deletions(-) delete mode 100644 pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/Argument.java (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/Argument.java') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/Argument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/Argument.java deleted file mode 100644 index 16a47a42..00000000 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/Argument.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2012 by A-SIT, Secure Information Technology Center Austria - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://joinup.ec.europa.eu/software/page/eupl - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - */ -package at.asit.pdfover.gui.cliarguments; - -import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.commons.Messages; -import at.asit.pdfover.gui.workflow.StateMachine; -import at.asit.pdfover.gui.workflow.Status; -import at.asit.pdfover.gui.workflow.config.ConfigurationManager; - -/** - * CLI Argument base class - * - * Implementing arguments have to be registered in PrepareConfigurationState - */ -public abstract class Argument { - - private String helpTextKey = null; - - private String[] commandOptions = null; - - private StateMachine stateMachine; - - /** - * @param commandOptions - * @param helpTextKey - */ - protected Argument(String[] commandOptions, String helpTextKey) { - this.helpTextKey = helpTextKey; - this.commandOptions = commandOptions; - } - - /** - * Set the state machine - * Used for configuration overlay manipulator and status - * @param stateMachine the state machine - */ - protected void setStateMachine(StateMachine stateMachine) { - this.stateMachine = stateMachine; - } - - protected ConfigurationManager getConfiguration() { - return this.stateMachine.configProvider; - } - - /** - * Get the status - * @return the status - */ - protected Status getStatus() { - return this.stateMachine.status; - } - - /** - * Set help text key - * @param key - */ - protected void setHelpTextKey(String key) { - this.helpTextKey = key; - } - - /** - * Gets help text - * @return help text - */ - public String getHelpText() { - return Messages.getString(this.helpTextKey); - } - - /** - * Set the command option in format: -... - * - * Examples: -h - * - * @param value - */ - protected void setCommandOptions(String[] value) { - this.commandOptions = value; - } - - /** - * Get the command option - * - * Examples: -h - * @return the command option - */ - public String[] getCommandOptions() { - return this.commandOptions; - } - - /** - * Invokes the argument to set stuff within the stateMachine - * - * It should return the offset within the args array where the last used argument of this Argument was used. - * - * Example: - * args[] = { "-h", "-b", "LOCAL" } - * - * Help Argument call: - * offset = 0 - * returns 0 - * - * BKU Argument call: - * offset = 1 - * returns 2 - * - * @param args - * @param argOffset - * @param handler - * @return returns the argumentOffset ending the section of this Argument - * @throws InitializationException - */ - public abstract int handleArgument(String[] args, int argOffset, ArgumentHandler handler) throws InitializationException; -} -- cgit v1.2.3