1 /* 2 StatCvs - CVS statistics generation 3 Copyright (C) 2002 Lukasz Pekacki <lukasz@pekacki.de> 4 http://statcvs.sf.net/ 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public 8 License as published by the Free Software Foundation; either 9 version 2.1 of the License, or (at your option) any later version. 10 11 This library is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with this library; if not, write to the Free Software 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 package net.sf.statcvs.input; 21 22 import java.util.Map; 23 24 /** 25 * <p>Interface for defining a Builder that constructs a data structure from 26 * a CVS logfile. {@link CvsLogfileParser} takes an instance of this 27 * interface and will call methods on the interface for every piece of 28 * data it encounters in the log.</p> 29 * 30 * <p>First, {@link #buildModule} will be called with the name of the 31 * module. Then, {@link #buildFile} will be called with the filename and 32 * other pieces of information of the first file in the log. Then, for 33 * every revision of this file, {@link #buildRevision} is called. The 34 * calls to <tt>buildFile</tt> and <tt>buildRevision</tt> are repeated 35 * for every file in the log.</p> 36 * 37 * <p>The files are in no particular order. The revisions of one file 38 * are ordered by time, beginning with the <em>most recent</em>.</p> 39 * 40 * @author Richard Cyganiak <richard@cyganiak.de> 41 * @author Tammo van Lessen 42 * @version $Id: CvsLogBuilder.java,v 1.3 2008/04/02 11:22:15 benoitx Exp $ 43 */ 44 public interface CvsLogBuilder { 45 46 /** 47 * Starts building a module. 48 * 49 * @param moduleName the name of the module 50 */ 51 public abstract void buildModule(String moduleName); 52 53 /** 54 * Starts building a new file. The files are not processed in any 55 * particular order. 56 * 57 * @param filename the file's name with path relative to the module, 58 * for example "path/file.txt" 59 * @param isBinary <tt>true</tt> if it's a binary file 60 * @param isInAttic <tt>true</tt> if the file is dead on the main branch 61 * @param revBySymnames maps revision (string) by symbolic name (string) 62 */ 63 public abstract void buildFile(String filename, boolean isBinary, boolean isInAttic, Map revBySymnames); 64 65 /** 66 * Adds a revision to the last file that was built.. The revisions are added in 67 * CVS logfile order, that is starting with the most recent one. 68 * 69 * @param data the revision 70 */ 71 public abstract void buildRevision(RevisionData data); 72 }