1 /* 2 * Copyright (C) 2016 Hobrasoft s.r.o. 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU Affero General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Affero General Public License for more details. 13 * 14 * You should have received a copy of the GNU Affero General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 package cz.hobrasoft.pdfmu.operation.args; 18 19 import cz.hobrasoft.pdfmu.operation.OperationException; 20 import net.sourceforge.argparse4j.inf.ArgumentParser; 21 import net.sourceforge.argparse4j.inf.Namespace; 22 23 /** 24 * Holds a set of named and type values 25 * 26 * @author <a href="mailto:filip.bartek@hobrasoft.cz">Filip Bartek</a> 27 */ 28 public interface ArgsConfiguration { 29 30 /** 31 * Adds arguments that configure this {@link ArgsConfiguration} to an 32 * {@link ArgumentParser} 33 * 34 * @param parser argument parser to add arguments to 35 */ 36 public void addArguments(ArgumentParser parser); 37 38 /** 39 * Sets configuration values from a parsed {@link Namespace} 40 * 41 * @param namespace the namespace with the argument values 42 * @throws OperationException when an exception occurs 43 */ 44 public void setFromNamespace(Namespace namespace) throws OperationException; 45 }