Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 26854 invoked from network); 16 Apr 2002 10:36:34 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 16 Apr 2002 10:36:34 -0000 Received: (qmail 10832 invoked by uid 97); 16 Apr 2002 10:36:27 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 10816 invoked by uid 97); 16 Apr 2002 10:36:27 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 10804 invoked by uid 97); 16 Apr 2002 10:36:26 -0000 Date: 16 Apr 2002 10:36:25 -0000 Message-ID: <20020416103625.94296.qmail@icarus.apache.org> From: conor@apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types EnumeratedAttribute.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N conor 02/04/16 03:36:25 Modified: src/main/org/apache/tools/ant/taskdefs Ant.java Available.java Chmod.java Cvs.java Deltree.java Echo.java ExecuteOn.java FixCRLF.java Javac.java Javadoc.java src/main/org/apache/tools/ant/types EnumeratedAttribute.java Log: Javadocs Revision Changes Path 1.55 +13 -0 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java Index: Ant.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v retrieving revision 1.54 retrieving revision 1.55 diff -u -w -u -r1.54 -r1.55 --- Ant.java 16 Apr 2002 07:15:18 -0000 1.54 +++ Ant.java 16 Apr 2002 10:36:25 -0000 1.55 @@ -535,16 +535,29 @@ public static class Reference extends org.apache.tools.ant.types.Reference { + /** Creates a reference to be configured by Ant */ public Reference() { super(); } private String targetid = null; + /** + * Set the id that this reference to be stored under in the + * new project. + * + * @param targetid the id under which this reference will be passed to + * the new project */ public void setToRefid(String targetid) { this.targetid = targetid; } + /** + * Get the id under which this reference will be stored in the new + * project + * + * @return the id of the reference in the new project. + */ public String getToRefid() { return targetid; } 1.44 +101 -6 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java Index: Available.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -w -u -r1.43 -r1.44 --- Available.java 15 Apr 2002 15:33:08 -0000 1.43 +++ Available.java 16 Apr 2002 10:36:25 -0000 1.44 @@ -69,7 +69,7 @@ /** * Will set the given property if the requested resource is available at - * runtime. + * runtime. This task may also be used as a condition by the condition task. * * @author Stefano Mazzocchi * stefano@apache.org @@ -93,10 +93,21 @@ private boolean isTask = false; private boolean ignoreSystemclasses = false; + /** + * Set the classpath to be used when searching for classes and resources + * + * @param classpath an Ant Path object containing the search path. + */ public void setClasspath(Path classpath) { createClasspath().append(classpath); } + /** + * Create a classpath object to be configured by Ant. The resulting + * path will be used when searching for classes or resources + * + * @return an empty Path instance to be configured by Ant. + */ public Path createClasspath() { if (this.classpath == null) { this.classpath = new Path(project); @@ -104,14 +115,31 @@ return this.classpath.createPath(); } + /** + * Set the classpath by reference. + * + * @param r a Reference to a Path instance to be used as the classpath + * value. + */ public void setClasspathRef(Reference r) { createClasspath().setRefid(r); } + /** + * Set the path to use when looking for a file + * + * @param filepath a Path instance containing the search path for files. + */ public void setFilepath(Path filepath) { createFilepath().append(filepath); } + /** + * Create a filepath to be configured by Ant. + * + * @return a new Path instance which Ant will configure with a file search + * path. + */ public Path createFilepath() { if (this.filepath == null) { this.filepath = new Path(project); @@ -119,24 +147,53 @@ return this.filepath.createPath(); } + /** + * Set the name of the property which will be set if the particular resource + * is available. + * + * @param property the name of the property to set. + */ public void setProperty(String property) { this.property = property; } + /** + * Set the value to be given to the property of the desired resource is + * available. + * + * @param value the value to be given. + */ public void setValue(String value) { this.value = value; } + /** + * Set a classname of a class which must be available to set the given + * property. + * + * @param classname the name of the class required. + */ public void setClassname(String classname) { if (!"".equals(classname)) { this.classname = classname; } } + /** + * Set the file which must be present in the file system to set the given + * property. + * + * @param file the name of the file which is required. + */ public void setFile(String file) { this.file = file; } + /** + * Set the name of a Java resouirce which is required to set the property. + * + * @param resource the name of a resource which is required to be available. + */ public void setResource(String resource) { this.resource = resource; } @@ -154,14 +211,32 @@ this.type.setValue(type); } + /** + * Set what type of file is required - either a directory or a file. + * + * @param type an instance of the FileDir enumeratedAttribute indicating + * whether the file required is to be a directory or a plain + * file. + */ public void setType(FileDir type) { this.type = type; } + /** + * Set whether the search for classes should ignore the runtime classes and + * just use the given classpath. + * + * @param ignore true if system classes are to be ignored. + */ public void setIgnoresystemclasses(boolean ignore) { this.ignoreSystemclasses = ignore; } + /** + * Entry point when operating as a task. + * + * @exception BuildException if the task is not configured correctly. + */ public void execute() throws BuildException { if (property == null) { throw new BuildException("property attribute is required", @@ -185,6 +260,12 @@ } } + /** + * Evaluate the availability of a resource. + * + * @return boolean is the resource is available. + * @exception if the condition is not configured correctly + */ public boolean eval() throws BuildException { if (classname == null && file == null && resource == null) { throw new BuildException("At least one of (classname|file|" @@ -422,24 +503,38 @@ } } + /** + * EnumeratedAttribute covering the file types to be checked for, either + * file or dir. + */ public static class FileDir extends EnumeratedAttribute { private static final String[] values = {"file", "dir"}; + /** + * @see EnumeratedAttribute#getValues + */ public String[] getValues() { return values; } + /** + * Indicate if the value specifies a directory. + * + * @return true if the value specifies a directory. + */ public boolean isDir() { return "dir".equalsIgnoreCase(getValue()); } + /** + * Indicate if the value specifies a file. + * + * @return true if the value specifies a file. + */ public boolean isFile() { return "file".equalsIgnoreCase(getValue()); } - public String toString() { - return getValue(); - } } } 1.26 +3 -0 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.java Index: Chmod.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -u -r1.25 -r1.26 --- Chmod.java 15 Apr 2002 15:33:08 -0000 1.25 +++ Chmod.java 16 Apr 2002 10:36:25 -0000 1.26 @@ -82,6 +82,9 @@ private boolean defaultSetDefined = false; private boolean havePerm = false; + /** + * Chmod task for setting file and directory permissions. + */ public Chmod() { super.setExecutable("chmod"); super.setParallel(true); 1.27 +3 -1 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Cvs.java Index: Cvs.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Cvs.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -w -u -r1.26 -r1.27 --- Cvs.java 15 Apr 2002 15:33:08 -0000 1.26 +++ Cvs.java 16 Apr 2002 10:36:25 -0000 1.27 @@ -74,7 +74,9 @@ */ public class Cvs extends AbstractCvsTask { + /** + * CVS Task - now implemented by the Abstract CVS Task base class + */ public Cvs() { - setTaskName("cvs"); } } 1.14 +11 -0 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Deltree.java Index: Deltree.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Deltree.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -u -r1.13 -r1.14 --- Deltree.java 11 Apr 2002 11:54:19 -0000 1.13 +++ Deltree.java 16 Apr 2002 10:36:25 -0000 1.14 @@ -74,10 +74,21 @@ private File dir; + /** + * Set the directory to be deleted + * + * @param dir the root of the tree to be removed. + */ public void setDir(File dir) { this.dir = dir; } + /** + * Do the work. + * + * @exception BuildException if the task is not configured correctly or + * the tree cannot be removed. + */ public void execute() throws BuildException { log("DEPRECATED - The deltree task is deprecated. " + "Use delete instead."); 1.20 +3 -0 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Echo.java Index: Echo.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Echo.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -u -r1.19 -r1.20 --- Echo.java 15 Apr 2002 15:33:08 -0000 1.19 +++ Echo.java 16 Apr 2002 10:36:25 -0000 1.20 @@ -163,6 +163,9 @@ } public static class EchoLevel extends EnumeratedAttribute { + /** + * @see EnumeratedAttribute#getValues + */ public String[] getValues() { return new String[] {"error", "warning", "info", "verbose", "debug"}; 1.29 +3 -0 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java Index: ExecuteOn.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -u -r1.28 -r1.29 --- ExecuteOn.java 15 Apr 2002 15:33:08 -0000 1.28 +++ ExecuteOn.java 16 Apr 2002 10:36:25 -0000 1.29 @@ -420,6 +420,9 @@ * for the type attribute. */ public static class FileDirBoth extends EnumeratedAttribute { + /** + * @see EnumeratedAttribute#getValues + */ public String[] getValues() { return new String[] {"file", "dir", "both"}; } 1.37 +4 -1 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java Index: FixCRLF.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -w -u -r1.36 -r1.37 --- FixCRLF.java 15 Apr 2002 14:56:29 -0000 1.36 +++ FixCRLF.java 16 Apr 2002 10:36:25 -0000 1.37 @@ -116,7 +116,7 @@ * * @author Sam Ruby rubys@us.ibm.com * @author Peter B. West - * @version $Revision: 1.36 $ $Name: $ + * @version $Revision: 1.37 $ $Name: $ * @since Ant 1.1 * * @ant.task category="filesystem" @@ -1036,6 +1036,9 @@ * Enumerated attribute with the values "asis", "cr", "lf" and "crlf". */ public static class CrLf extends EnumeratedAttribute { + /** + * @see EnumeratedAttribute#getValues + */ public String[] getValues() { return new String[] {"asis", "cr", "lf", "crlf"}; } 1.100 +4 -1 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java Index: Javac.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v retrieving revision 1.99 retrieving revision 1.100 diff -u -w -u -r1.99 -r1.100 --- Javac.java 15 Apr 2002 23:53:14 -0000 1.99 +++ Javac.java 16 Apr 2002 10:36:25 -0000 1.100 @@ -102,7 +102,7 @@ * @author Stefan Bodewig * @author J D Glanville * - * @version $Revision: 1.99 $ + * @version $Revision: 1.100 $ * * @since Ant 1.1 * @@ -143,6 +143,9 @@ private String source; private String debugLevel; + /** + * Javac task for compilation of Java files. + */ public Javac() { if (JavaEnvUtils.getJavaVersion() != JavaEnvUtils.JAVA_1_1 && JavaEnvUtils.getJavaVersion() != JavaEnvUtils.JAVA_1_2) { 1.92 +0 -1 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java Index: Javadoc.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v retrieving revision 1.91 retrieving revision 1.92 diff -u -w -u -r1.91 -r1.92 --- Javadoc.java 15 Apr 2002 15:33:09 -0000 1.91 +++ Javadoc.java 16 Apr 2002 10:36:25 -0000 1.92 @@ -108,7 +108,6 @@ * * @ant.task category="java" */ - public class Javadoc extends Task { public class DocletParam { 1.8 +11 -0 jakarta-ant/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java Index: EnumeratedAttribute.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -u -r1.7 -r1.8 --- EnumeratedAttribute.java 11 Jan 2002 21:03:57 -0000 1.7 +++ EnumeratedAttribute.java 16 Apr 2002 10:36:25 -0000 1.8 @@ -143,4 +143,15 @@ public final int getIndex() { return index; } + + + /** + * Convert the value to its string form. + * + * @return the string form of the value. + */ + public String toString() { + return getValue(); + } + } -- To unsubscribe, e-mail: For additional commands, e-mail: