View Javadoc
1 /* 2 AntMake 3 4 Copyright (C) 2004 Jose San Leandro Armend?riz 5 jsanleandro@yahoo.es 6 chousz@yahoo.com 7 8 This library is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public 10 License as published by the Free Software Foundation; either 11 version 2 of the License, or (at your option) any later version. 12 13 This library is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 General Public License for more details. 17 18 You should have received a copy of the GNU General Public 19 License along with this library; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 22 Thanks to ACM S.L. for distributing this library under the GPL license. 23 Contact info: jsr000@terra.es 24 Postal Address: c/Playa de Lagoa, 1 25 Urb. Valdecaba?as 26 Boadilla del monte 27 28660 Madrid 28 Spain 29 30 ****************************************************************************** 31 This class is based on CVSEntry 32 included in Ant distribution, and whose license details 33 are the following. 34 35 * 36 * The Apache Software License, Version 1.1 37 * 38 * Copyright (c) 2002 The Apache Software Foundation. All rights 39 * reserved. 40 * 41 * Redistribution and use in source and binary forms, with or without 42 * modification, are permitted provided that the following conditions 43 * are met: 44 * 45 * 1. Redistributions of source code must retain the above copyright 46 * notice, this list of conditions and the following disclaimer. 47 * 48 * 2. Redistributions in binary form must reproduce the above copyright 49 * notice, this list of conditions and the following disclaimer in 50 * the documentation and/or other materials provided with the 51 * distribution. 52 * 53 * 3. The end-user documentation included with the redistribution, if 54 * any, must include the following acknowlegement: 55 * "This product includes software developed by the 56 * Apache Software Foundation (http://www.apache.org/)." 57 * Alternately, this acknowlegement may appear in the software itself, 58 * if and wherever such third-party acknowlegements normally appear. 59 * 60 * 4. The names "Ant" and "Apache Software 61 * Foundation" must not be used to endorse or promote products derived 62 * from this software without prior written permission. For written 63 * permission, please contact apache@apache.org. 64 * 65 * 5. Products derived from this software may not be called "Apache" 66 * nor may "Apache" appear in their names without prior written 67 * permission of the Apache Group. 68 * 69 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 70 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 71 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 72 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 73 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 74 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 75 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 76 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 77 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 78 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 79 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 80 * SUCH DAMAGE. 81 * ==================================================================== 82 * 83 * This software consists of voluntary contributions made by many 84 * individuals on behalf of the Apache Software Foundation. For more 85 * information on the Apache Software Foundation, please see 86 * <http://www.apache.org/>. 87 * 88 89 ****************************************************************************** 90 * 91 * Filename: $RCSfile: AntMakeTask.java,v $ 92 * 93 * Author: Jose San Leandro Armend?riz 94 * 95 * Description: Models CVS entries. 96 * 97 * Last modified by: $Author: chous $ at $Date: 2004/01/24 11:17:06 $ 98 * 99 * File version: $Revision: 1.8 $ 100 * 101 * Project version: $Name: $ 102 * 103 * $Id: AntMakeTask.java,v 1.8 2004/01/24 11:17:06 chous Exp $ 104 * 105 */ 106 package org.acmsl.antmake; 107 108 /* 109 * Importing project classes. 110 */ 111 import org.acmsl.antmake.RcsFile; 112 113 /* 114 * Importing JDK classes. 115 */ 116 import java.util.ArrayList; 117 import java.util.Collection; 118 import java.util.Date; 119 120 /*** 121 * Models CVS entries. 122 * @author <a href="mailto:jsanleandro@yahoo.es" 123 >Jose San Leandro</a>, based on 124 * <a href="mailto:jeff.martin@synamic.co.uk">Jeff Martin</a> and 125 * <a href="mailto:peter@apache.org">Peter Donald</a>'s 126 * CVSEntry. It's package-protected, so it had to be basically copied 127 * and pasted. 128 * @version $Revision: 1.8 $ 129 * @see org.apache.tools.ant.taskdefs.cvslib.CVSEntry 130 */ 131 public class CvsEntry 132 { 133 /*** 134 * The date. 135 */ 136 private Date m__Date; 137 138 /*** 139 * The author. 140 */ 141 private String m__strAuthor; 142 143 /*** 144 * The comment. 145 */ 146 private String m__strComment; 147 148 /*** 149 * The RCS files. 150 */ 151 private Collection m__cRcsFiles; 152 153 /*** 154 * Creates a CvsEntry with given information. 155 * @param date the date. 156 * @param author the author. 157 * @param comment the comment. 158 */ 159 public CvsEntry(Date date, String author, String comment) 160 { 161 inmutableSetDate(date); 162 inmutableSetAuthor(author); 163 inmutableSetComment(comment); 164 } 165 166 /*** 167 * Specifies the date. 168 * @param date the date. 169 */ 170 private void inmutableSetDate(Date date) 171 { 172 m__Date = date; 173 } 174 175 /*** 176 * Specifies the date. 177 * @param date the date. 178 */ 179 protected void setDate(Date date) 180 { 181 inmutableSetDate(date); 182 } 183 184 /*** 185 * Retrieves the date. 186 * @return such information. 187 */ 188 public Date getDate() 189 { 190 return m__Date; 191 } 192 193 /*** 194 * Specifies the author. 195 * @param author the author. 196 */ 197 private void inmutableSetAuthor(String author) 198 { 199 m__strAuthor = author; 200 } 201 202 /*** 203 * Specifies the author. 204 * @param author the author. 205 */ 206 protected void setAuthor(String author) 207 { 208 inmutableSetAuthor(author); 209 } 210 211 /*** 212 * Retrieves the author. 213 * @return such information. 214 */ 215 public String getAuthor() 216 { 217 return m__strAuthor; 218 } 219 220 /*** 221 * Specifies the comment. 222 * @param comment the comment. 223 */ 224 private void inmutableSetComment(String comment) 225 { 226 m__strComment = comment; 227 } 228 229 /*** 230 * Specifies the comment. 231 * @param comment the comment. 232 */ 233 protected void setComment(String comment) 234 { 235 inmutableSetComment(comment); 236 } 237 238 /*** 239 * Retrieves the comment. 240 * @return such information. 241 */ 242 public String getComment() 243 { 244 return m__strComment; 245 } 246 247 /*** 248 * Specifies the file collection. 249 * @param collection such collection. 250 */ 251 protected void setRcsFiles(Collection collection) 252 { 253 m__cRcsFiles = collection; 254 } 255 256 /*** 257 * Retrieves the file collection. 258 * @return such collection. 259 */ 260 public Collection getRcsFiles() 261 { 262 return m__cRcsFiles; 263 } 264 265 /*** 266 * Adds a new RCS file. 267 * @param rcsFile the file to add. 268 */ 269 public void add(RcsFile rcsFile) 270 { 271 if (rcsFile != null) 272 { 273 Collection t_cRcsFiles = getRcsFiles(); 274 275 if (t_cRcsFiles == null) 276 { 277 t_cRcsFiles = new ArrayList(); 278 setRcsFiles(t_cRcsFiles); 279 } 280 281 t_cRcsFiles.add(rcsFile); 282 } 283 } 284 285 /*** 286 * Adds a new file. 287 * @param name the file name. 288 * @param revision the file revision. 289 */ 290 public void add(String name, String revision) 291 { 292 if ( (name != null) 293 && (revision != null)) 294 { 295 add(new RcsFile(name, revision)); 296 } 297 } 298 299 /*** 300 * Adds a new file. 301 * @param name the file name. 302 * @param revision the file revision. 303 * @param previousRevision the previous revision. 304 */ 305 public void add(String name, String revision, String previousRevision) 306 { 307 if ( (name != null) 308 && (revision != null) 309 && (previousRevision != null)) 310 { 311 add(new RcsFile(name, revision, previousRevision)); 312 } 313 } 314 } 315

This page was automatically generated by Maven