001/* 
002 * Copyright (C) 2016 Hobrasoft s.r.o.
003 *
004 * This program is free software: you can redistribute it and/or modify
005 * it under the terms of the GNU Affero General Public License as published by
006 * the Free Software Foundation, either version 3 of the License, or
007 * (at your option) any later version.
008 *
009 * This program is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012 * GNU Affero General Public License for more details.
013 *
014 * You should have received a copy of the GNU Affero General Public License
015 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
016 */
017package cz.hobrasoft.pdfmu.operation.args;
018
019import cz.hobrasoft.pdfmu.operation.OperationException;
020import net.sourceforge.argparse4j.inf.ArgumentParser;
021import net.sourceforge.argparse4j.inf.Namespace;
022
023/**
024 * Holds a set of named and type values
025 *
026 * @author <a href="mailto:filip.bartek@hobrasoft.cz">Filip Bartek</a>
027 */
028public interface ArgsConfiguration {
029
030    /**
031     * Adds arguments that configure this {@link ArgsConfiguration} to an
032     * {@link ArgumentParser}
033     *
034     * @param parser argument parser to add arguments to
035     */
036    public void addArguments(ArgumentParser parser);
037
038    /**
039     * Sets configuration values from a parsed {@link Namespace}
040     *
041     * @param namespace the namespace with the argument values
042     * @throws OperationException when an exception occurs
043     */
044    public void setFromNamespace(Namespace namespace) throws OperationException;
045}