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; 18 19 import cz.hobrasoft.pdfmu.TextOutput; 20 import cz.hobrasoft.pdfmu.WritingMapper; 21 import net.sourceforge.argparse4j.inf.Namespace; 22 import net.sourceforge.argparse4j.inf.Subparser; 23 24 /** 25 * Manipulates a PDF file 26 * 27 * @author <a href="mailto:filip.bartek@hobrasoft.cz">Filip Bartek</a> 28 */ 29 public interface Operation { 30 31 /** 32 * Configure this operation's subparser 33 * 34 * <p> 35 * The subparser handles the arguments accepted by this operation. 36 * 37 * @param subparser Subparser object to configure, especially adding 38 * arguments 39 * @return the subparser added to {@code subparsers} 40 */ 41 public Subparser configureSubparser(Subparser subparser); 42 43 /** 44 * Executes the operation 45 * 46 * @param namespace parsed command line arguments 47 * @throws OperationException if some condition prevents the operation from 48 * finishing 49 */ 50 public void execute(Namespace namespace) throws OperationException; 51 52 public void setWritingMapper(WritingMapper wm); 53 54 public void setTextOutput(TextOutput to); 55 }