ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/types/selectors BaseSelectorContainer.java ContainsRegexpSelector.java ContainsSelector.java DateSelector.java DependSelector.java DepthSelector.java DifferentSelector.java ExtendSelector.java FilenameSelector.java MajoritySelector.java MappingSelector.java PresentSelector.java SelectSelector.java SelectorContainer.java SelectorScanner.java SelectorUtils.java SizeSelector.java TypeSelector.java
Date Tue, 29 Jul 2003 08:37:19 GMT
peterreilly    2003/07/29 01:37:19

  Modified:    src/main/org/apache/tools/ant/types/selectors
                        BaseSelectorContainer.java
                        ContainsRegexpSelector.java ContainsSelector.java
                        DateSelector.java DependSelector.java
                        DepthSelector.java DifferentSelector.java
                        ExtendSelector.java FilenameSelector.java
                        MajoritySelector.java MappingSelector.java
                        PresentSelector.java SelectSelector.java
                        SelectorContainer.java SelectorScanner.java
                        SelectorUtils.java SizeSelector.java
                        TypeSelector.java
  Log:
  style
  
  Revision  Changes    Path
  1.11      +23 -0     ant/src/main/org/apache/tools/ant/types/selectors/BaseSelectorContainer.java
  
  Index: BaseSelectorContainer.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/BaseSelectorContainer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BaseSelectorContainer.java	4 Jul 2003 23:18:49 -0000	1.10
  +++ BaseSelectorContainer.java	29 Jul 2003 08:37:17 -0000	1.11
  @@ -80,6 +80,7 @@
   
       /**
        * Indicates whether there are any selectors here.
  +     * @return true if there are selectors
        */
       public boolean hasSelectors() {
           return !(selectorsList.isEmpty());
  @@ -87,6 +88,7 @@
   
       /**
        * Gives the count of the number of selectors in this container
  +     * @return the number of selectors
        */
       public int selectorCount() {
           return selectorsList.size();
  @@ -94,6 +96,8 @@
   
       /**
        * Returns the set of selectors as an array.
  +     * @param p the current project
  +     * @return an array of selectors
        */
       public FileSelector[] getSelectors(Project p) {
           FileSelector[] result = new FileSelector[selectorsList.size()];
  @@ -103,6 +107,7 @@
   
       /**
        * Returns an enumerator for accessing the set of selectors.
  +     * @return an enumerator for the selectors
        */
       public Enumeration selectorElements() {
           return selectorsList.elements();
  @@ -189,6 +194,7 @@
   
       /**
        * add a "Select" selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addSelector(SelectSelector selector) {
           appendSelector(selector);
  @@ -196,6 +202,7 @@
   
       /**
        * add an "And" selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addAnd(AndSelector selector) {
           appendSelector(selector);
  @@ -203,6 +210,7 @@
   
       /**
        * add an "Or" selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addOr(OrSelector selector) {
           appendSelector(selector);
  @@ -210,6 +218,7 @@
   
       /**
        * add a "Not" selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addNot(NotSelector selector) {
           appendSelector(selector);
  @@ -217,6 +226,7 @@
   
       /**
        * add a "None" selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addNone(NoneSelector selector) {
           appendSelector(selector);
  @@ -224,6 +234,7 @@
   
       /**
        * add a majority selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addMajority(MajoritySelector selector) {
           appendSelector(selector);
  @@ -231,6 +242,7 @@
   
       /**
        * add a selector date entry on the selector list
  +     * @param selector the selector to add
        */
       public void addDate(DateSelector selector) {
           appendSelector(selector);
  @@ -238,6 +250,7 @@
   
       /**
        * add a selector size entry on the selector list
  +     * @param selector the selector to add
        */
       public void addSize(SizeSelector selector) {
           appendSelector(selector);
  @@ -245,6 +258,7 @@
   
       /**
        * add a selector filename entry on the selector list
  +     * @param selector the selector to add
        */
       public void addFilename(FilenameSelector selector) {
           appendSelector(selector);
  @@ -252,6 +266,7 @@
   
       /**
        * add an extended selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addCustom(ExtendSelector selector) {
           appendSelector(selector);
  @@ -259,6 +274,7 @@
   
       /**
        * add a contains selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addContains(ContainsSelector selector) {
           appendSelector(selector);
  @@ -266,6 +282,7 @@
   
       /**
        * add a present selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addPresent(PresentSelector selector) {
           appendSelector(selector);
  @@ -273,6 +290,7 @@
   
       /**
        * add a depth selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addDepth(DepthSelector selector) {
           appendSelector(selector);
  @@ -280,6 +298,7 @@
   
       /**
        * add a depends selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addDepend(DependSelector selector) {
           appendSelector(selector);
  @@ -287,6 +306,7 @@
   
       /**
        * adds a different selector to the selector list
  +     * @param selector the selector to add
        */
       public void addDifferent(DifferentSelector selector) {
           appendSelector(selector);
  @@ -294,6 +314,7 @@
   
       /**
        * adds a type selector to the selector list
  +     * @param selector the selector to add
        */
       public void addType(TypeSelector selector) {
           appendSelector(selector);
  @@ -301,6 +322,7 @@
   
       /**
        * add a regular expression selector entry on the selector list
  +     * @param selector the selector to add
        */
       public void addContainsRegexp(ContainsRegexpSelector selector) {
           appendSelector(selector);
  @@ -309,6 +331,7 @@
   
       /**
        * add an arbitary selector
  +     * @param selector the selector to add
        * @since Ant 1.6
        */
       public void add(FileSelector selector) {
  
  
  
  1.5       +10 -3     ant/src/main/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java
  
  Index: ContainsRegexpSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ContainsRegexpSelector.java	24 Jul 2003 12:53:35 -0000	1.4
  +++ ContainsRegexpSelector.java	29 Jul 2003 08:37:18 -0000	1.5
  @@ -76,11 +76,18 @@
       private String userProvidedExpression = null;
       private RegularExpression myRegExp = null;
       private Regexp myExpression = null;
  -    public final static String EXPRESSION_KEY = "expression";
  +    /** Key to used for parameterized custom selector */
  +    public static final String EXPRESSION_KEY = "expression";
   
  +    /**
  +     * Creates a new <code>ContainsRegexpSelector</code> instance.
  +     */
       public ContainsRegexpSelector() {
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer(
                   "{containsregexpselector expression: ");
  @@ -162,7 +169,7 @@
   
               while (teststr != null) {
   
  -                if (myExpression.matches(teststr) == true) {
  +                if (myExpression.matches(teststr)) {
                       return true;
                   }
                   teststr = in.readLine();
  @@ -176,7 +183,7 @@
                   try {
                       in.close();
                   } catch (Exception e) {
  -                    throw new BuildException("Could not close file " 
  +                    throw new BuildException("Could not close file "
                                                + filename);
                   }
               }
  
  
  
  1.10      +16 -4     ant/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java
  
  Index: ContainsSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ContainsSelector.java	24 Jul 2003 12:53:35 -0000	1.9
  +++ ContainsSelector.java	29 Jul 2003 08:37:18 -0000	1.10
  @@ -76,14 +76,26 @@
       private String contains = null;
       private boolean casesensitive = true;
       private boolean ignorewhitespace = false;
  -    public final static String CONTAINS_KEY = "text";
  -    public final static String CASE_KEY = "casesensitive";
  -    public final static String WHITESPACE_KEY = "ignorewhitespace";
  +    /** Key to used for parameterized custom selector */
  +    public static final String EXPRESSION_KEY = "expression";
  +    /** Used for parameterized custom selector */
  +    public static final String CONTAINS_KEY = "text";
  +    /** Used for parameterized custom selector */
  +    public static final String CASE_KEY = "casesensitive";
  +    /** Used for parameterized custom selector */
  +    public static final String WHITESPACE_KEY = "ignorewhitespace";
   
   
  +    /**
  +     * Creates a new <code>ContainsSelector</code> instance.
  +     *
  +     */
       public ContainsSelector() {
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer("{containsselector text: ");
           buf.append(contains);
  @@ -218,7 +230,7 @@
                   try {
                       in.close();
                   } catch (Exception e) {
  -                    throw new BuildException("Could not close file " 
  +                    throw new BuildException("Could not close file "
                                                + filename);
                   }
               }
  
  
  
  1.7       +23 -6     ant/src/main/org/apache/tools/ant/types/selectors/DateSelector.java
  
  Index: DateSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/DateSelector.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DateSelector.java	19 Jul 2003 08:11:08 -0000	1.6
  +++ DateSelector.java	29 Jul 2003 08:37:18 -0000	1.7
  @@ -77,18 +77,30 @@
       private boolean includeDirs = false;
       private int granularity = 0;
       private int cmp = 2;
  -    public final static String MILLIS_KEY = "millis";
  -    public final static String DATETIME_KEY = "datetime";
  -    public final static String CHECKDIRS_KEY = "checkdirs";
  -    public final static String GRANULARITY_KEY = "granularity";
  -    public final static String WHEN_KEY = "when";
  +    /** Key to used for parameterized custom selector */
  +    public static final String MILLIS_KEY = "millis";
  +    /** Key to used for parameterized custom selector */
  +    public static final String DATETIME_KEY = "datetime";
  +    /** Key to used for parameterized custom selector */
  +    public static final String CHECKDIRS_KEY = "checkdirs";
  +    /** Key to used for parameterized custom selector */
  +    public static final String GRANULARITY_KEY = "granularity";
  +    /** Key to used for parameterized custom selector */
  +    public static final String WHEN_KEY = "when";
   
  +    /**
  +     * Creates a new <code>DateSelector</code> instance.
  +     *
  +     */
       public DateSelector() {
           if (Os.isFamily("dos")) {
               granularity = 2000;
           }
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer("{dateselector date: ");
           buf.append(dateTime);
  @@ -118,6 +130,7 @@
   
       /**
        * Returns the millisecond value the selector is set for.
  +     * @return the millisecond value
        */
       public long getMillis() {
           return millis;
  @@ -163,6 +176,7 @@
       /**
        * Sets the number of milliseconds leeway we will give before we consider
        * a file not to have matched a date.
  +     * @param granularity the number of milliconds leeway
        */
       public void setGranularity(int granularity) {
           this.granularity = granularity;
  @@ -246,7 +260,7 @@
        */
       public boolean isSelected(File basedir, String filename, File file) {
           validate();
  -        if (file.isDirectory() && (includeDirs == false)) {
  +        if (file.isDirectory() && (!includeDirs)) {
               return true;
           }
           if (cmp == 0) {
  @@ -263,6 +277,9 @@
        * <p>
        */
       public static class TimeComparisons extends EnumeratedAttribute {
  +        /**
  +         * @return the values as an array of strings
  +         */
           public String[] getValues() {
               return new String[]{"before", "after", "equal"};
           }
  
  
  
  1.11      +10 -3     ant/src/main/org/apache/tools/ant/types/selectors/DependSelector.java
  
  Index: DependSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/DependSelector.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DependSelector.java	4 Jul 2003 23:18:49 -0000	1.10
  +++ DependSelector.java	29 Jul 2003 08:37:18 -0000	1.11
  @@ -67,10 +67,17 @@
    */
   public class DependSelector extends MappingSelector {
   
  +    /**
  +     * Creates a new <code>DependSelector</code> instance.
  +     *
  +     */
       public DependSelector() {
   
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer("{dependselector targetdir: ");
           if (targetdir == null) {
  @@ -94,9 +101,9 @@
   
       /**
        * this test is our selection test that compared the file with the destfile
  -     * @param srcfile
  -     * @param destfile
  -     * @return
  +     * @param srcfile the source file
  +     * @param destfile the destination file
  +     * @return true if destination is out of date
        */
       public boolean selectionTest(File srcfile, File destfile) {
           boolean selected = SelectorUtils.isOutOfDate(srcfile, destfile,
  
  
  
  1.7       +22 -13    ant/src/main/org/apache/tools/ant/types/selectors/DepthSelector.java
  
  Index: DepthSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/DepthSelector.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DepthSelector.java	19 Jul 2003 08:11:08 -0000	1.6
  +++ DepthSelector.java	29 Jul 2003 08:37:18 -0000	1.7
  @@ -71,12 +71,21 @@
   
       public int min = -1;
       public int max = -1;
  -    public final static String MIN_KEY = "min";
  -    public final static String MAX_KEY = "max";
  +    /** Used for parameterized custom selector */
  +    public static final String MIN_KEY = "min";
  +    /** Used for parameterized custom selector */
  +    public static final String MAX_KEY = "max";
   
  +    /**
  +     * Creates a new <code>DepthSelector</code> instance.
  +     *
  +     */
       public DepthSelector() {
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer("{depthselector min: ");
           buf.append(min);
  @@ -169,20 +178,20 @@
   
           int depth = -1;
           // If you felt daring, you could cache the basedir absolute path
  -        String abs_base = basedir.getAbsolutePath();
  -        String abs_file = file.getAbsolutePath();
  -        StringTokenizer tok_base = new StringTokenizer(abs_base,
  +        String absBase = basedir.getAbsolutePath();
  +        String absFile = file.getAbsolutePath();
  +        StringTokenizer tokBase = new StringTokenizer(absBase,
                   File.separator);
  -        StringTokenizer tok_file = new StringTokenizer(abs_file,
  +        StringTokenizer tokFile = new StringTokenizer(absFile,
                   File.separator);
  -        while (tok_file.hasMoreTokens()) {
  -            String filetoken = tok_file.nextToken();
  -            if (tok_base.hasMoreTokens()) {
  -                String basetoken = tok_base.nextToken();
  +        while (tokFile.hasMoreTokens()) {
  +            String filetoken = tokFile.nextToken();
  +            if (tokBase.hasMoreTokens()) {
  +                String basetoken = tokBase.nextToken();
                   // Sanity check. Ditch it if you want faster performance
                   if (!basetoken.equals(filetoken)) {
                       throw new BuildException("File " + filename
  -                            + " does not appear within " + abs_base
  +                            + " does not appear within " + absBase
                               + "directory");
                   }
               } else {
  @@ -192,9 +201,9 @@
                   }
               }
           }
  -        if (tok_base.hasMoreTokens()) {
  +        if (tokBase.hasMoreTokens()) {
               throw new BuildException("File " + filename
  -                + " is outside of " + abs_base + "directory tree");
  +                + " is outside of " + absBase + "directory tree");
           }
           if (min > -1 && depth < min) {
               return false;
  
  
  
  1.8       +5 -4      ant/src/main/org/apache/tools/ant/types/selectors/DifferentSelector.java
  
  Index: DifferentSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/DifferentSelector.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DifferentSelector.java	4 Jul 2003 23:18:49 -0000	1.7
  +++ DifferentSelector.java	29 Jul 2003 08:37:18 -0000	1.8
  @@ -78,6 +78,7 @@
    * over as few files as possible, perhaps following it with an &lt;uptodate;&gt
    * to keep the descendent routines conditional.
    *
  + * @author not specified
    */
   public class DifferentSelector extends MappingSelector {
   
  @@ -88,7 +89,7 @@
   
       /**
        * This flag tells the selector to ignore file times in the comparison
  -     * @param ignoreFileTimes
  +     * @param ignoreFileTimes if true ignore file times
        */
       public void setIgnoreFileTimes(boolean ignoreFileTimes) {
           this.ignoreFileTimes = ignoreFileTimes;
  @@ -96,9 +97,9 @@
   
       /**
        * this test is our selection test that compared the file with the destfile
  -     * @param srcfile
  -     * @param destfile
  -     * @return
  +     * @param srcfile the source file
  +     * @param destfile the destination file
  +     * @return true if the files are different
        */
       protected boolean selectionTest(File srcfile, File destfile) {
   
  
  
  
  1.13      +6 -0      ant/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java
  
  Index: ExtendSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ExtendSelector.java	19 Jul 2003 11:20:22 -0000	1.12
  +++ ExtendSelector.java	29 Jul 2003 08:37:18 -0000	1.13
  @@ -138,6 +138,7 @@
   
       /**
        * Set the classpath to load the classname specified using an attribute.
  +     * @param classpath the classpath to use
        */
       public final void setClasspath(Path classpath) {
           if (isReference()) {
  @@ -152,6 +153,7 @@
   
       /**
        * Specify the classpath to use to load the Selector (nested element).
  +     * @return a classpath to be configured
        */
       public final Path createClasspath() {
           if (isReference()) {
  @@ -165,6 +167,7 @@
   
       /**
        * Get the classpath
  +     * @return the classpath
        */
       public final Path getClasspath() {
           return classpath;
  @@ -173,6 +176,7 @@
       /**
        * Set the classpath to use for loading a custom selector by using
        * a reference.
  +     * @param r a reference to the classpath
        */
       public void setClasspathref(Reference r) {
           if (isReference()) {
  @@ -211,6 +215,8 @@
        * since we know we must have them all by now. And since we must know
        * both classpath and classname, creating the class is deferred to here
        * as well.
  +     *
  +     * @exception BuildException if an error occurs
        */
       public boolean isSelected(File basedir, String filename, File file)
               throws BuildException {
  
  
  
  1.6       +14 -3     ant/src/main/org/apache/tools/ant/types/selectors/FilenameSelector.java
  
  Index: FilenameSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/FilenameSelector.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FilenameSelector.java	4 Jul 2003 23:18:49 -0000	1.5
  +++ FilenameSelector.java	29 Jul 2003 08:37:18 -0000	1.6
  @@ -69,14 +69,25 @@
   
       private String pattern = null;
       private boolean casesensitive = true;
  +
       private boolean negated = false;
  -    public final static String NAME_KEY = "name";
  -    public final static String CASE_KEY = "casesensitive";
  -    public final static String NEGATE_KEY = "negate";
  +    /** Used for parameterized custom selector */
  +    public static final String NAME_KEY = "name";
  +    /** Used for parameterized custom selector */
  +    public static final String CASE_KEY = "casesensitive";
  +    /** Used for parameterized custom selector */
  +    public static final String NEGATE_KEY = "negate";
   
  +    /**
  +     * Creates a new <code>FilenameSelector</code> instance.
  +     *
  +     */
       public FilenameSelector() {
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer("{filenameselector name: ");
           buf.append(pattern);
  
  
  
  1.4       +10 -0     ant/src/main/org/apache/tools/ant/types/selectors/MajoritySelector.java
  
  Index: MajoritySelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/MajoritySelector.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MajoritySelector.java	4 Jul 2003 23:18:49 -0000	1.3
  +++ MajoritySelector.java	29 Jul 2003 08:37:18 -0000	1.4
  @@ -79,6 +79,9 @@
       public MajoritySelector() {
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer();
           if (hasSelectors()) {
  @@ -89,6 +92,13 @@
           return buf.toString();
       }
   
  +    /**
  +     * A attribute to specify what will happen if number
  +     * of yes votes is the same as the number of no votes
  +     * defaults to true
  +     *
  +     * @param tiebreaker the value to give if there is a tie
  +     */
       public void setAllowtie(boolean tiebreaker) {
           allowtie = tiebreaker;
       }
  
  
  
  1.6       +9 -1      ant/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java
  
  Index: MappingSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MappingSelector.java	4 Jul 2003 23:18:49 -0000	1.5
  +++ MappingSelector.java	29 Jul 2003 08:37:18 -0000	1.6
  @@ -65,6 +65,7 @@
   /**
    * A mapping selector is an abstract class adding mapping support to the base
    * selector
  + * @author not specified
    */
   public abstract class MappingSelector extends BaseSelector {
       protected File targetdir = null;
  @@ -72,6 +73,10 @@
       protected FileNameMapper map = null;
       protected int granularity = 0;
   
  +    /**
  +     * Creates a new <code>MappingSelector</code> instance.
  +     *
  +     */
       public MappingSelector() {
           if (Os.isFamily("dos")) {
               granularity = 2000;
  @@ -91,6 +96,8 @@
   
       /**
        * Defines the FileNameMapper to use (nested mapper element).
  +     * @return a mapper to be configured
  +     * @throws BuildException if more that one mapper defined
        */
       public Mapper createMapper() throws BuildException {
           if (mapperElement != null) {
  @@ -155,7 +162,7 @@
        * this test is our selection test that compared the file with the destfile
        * @param srcfile file to test; may be null
        * @param destfile destination file
  -     * @return
  +     * @return true if source file compares with destination file
        */
       protected abstract boolean selectionTest(File srcfile, File destfile);
   
  @@ -163,6 +170,7 @@
        * Sets the number of milliseconds leeway we will give before we consider
        * a file out of date. Defaults to 2000 on MS-DOS derivatives as the FAT
        * file system.
  +     * @param granularity the leeway in milliseconds
        */
       public void setGranularity(int granularity) {
           this.granularity = granularity;
  
  
  
  1.8       +12 -0     ant/src/main/org/apache/tools/ant/types/selectors/PresentSelector.java
  
  Index: PresentSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/PresentSelector.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PresentSelector.java	4 Jul 2003 23:18:49 -0000	1.7
  +++ PresentSelector.java	29 Jul 2003 08:37:18 -0000	1.8
  @@ -78,9 +78,16 @@
       private FileNameMapper map = null;
       private boolean destmustexist = true;
   
  +    /**
  +     * Creates a new <code>PresentSelector</code> instance.
  +     *
  +     */
       public PresentSelector() {
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer("{presentselector targetdir: ");
           if (targetdir == null) {
  @@ -115,6 +122,8 @@
   
       /**
        * Defines the FileNameMapper to use (nested mapper element).
  +     * @return a mapper to be configured
  +     * @throws BuildException if more that one mapper defined
        */
       public Mapper createMapper() throws BuildException {
           if (mapperElement != null) {
  @@ -197,6 +206,9 @@
        * presence is allowed and required.
        */
       public static class FilePresence extends EnumeratedAttribute {
  +        /**
  +         * @return the values as an array of strings
  +         */
           public String[] getValues() {
               return new String[]{"srconly", "both"};
           }
  
  
  
  1.10      +11 -0     ant/src/main/org/apache/tools/ant/types/selectors/SelectSelector.java
  
  Index: SelectSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/SelectSelector.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SelectSelector.java	19 Jul 2003 11:20:22 -0000	1.9
  +++ SelectSelector.java	29 Jul 2003 08:37:18 -0000	1.10
  @@ -81,6 +81,9 @@
       public SelectSelector() {
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer();
           if (hasSelectors()) {
  @@ -111,6 +114,7 @@
   
       /**
        * Indicates whether there are any selectors here.
  +     * @return whether any selectors are in this container
        */
       public boolean hasSelectors() {
           if (isReference()) {
  @@ -121,6 +125,7 @@
   
       /**
        * Gives the count of the number of selectors in this container
  +     * @return the number of selectors in this container
        */
       public int selectorCount() {
           if (isReference()) {
  @@ -131,6 +136,8 @@
   
       /**
        * Returns the set of selectors as an array.
  +     * @param p the current project
  +     * @return an array of selectors in this container
        */
       public FileSelector[] getSelectors(Project p) {
           if (isReference()) {
  @@ -141,6 +148,7 @@
   
       /**
        * Returns an enumerator for accessing the set of selectors.
  +     * @return an enumerator that goes through each of the selectors
        */
       public Enumeration selectorElements() {
           if (isReference()) {
  @@ -177,6 +185,7 @@
       /**
        * Ensures that the selector passes the conditions placed
        * on it with <code>if</code> and <code>unless</code>.
  +     * @return true if conditions are passed
        */
       public boolean passesConditions() {
           if (ifProperty != null
  @@ -192,6 +201,7 @@
       /**
        * Sets the if attribute to a property which must exist for the
        * selector to select any files.
  +     * @param ifProperty the property to check
        */
       public void setIf(String ifProperty) {
           this.ifProperty = ifProperty;
  @@ -200,6 +210,7 @@
       /**
        * Sets the unless attribute to a property which cannot exist for the
        * selector to select any files.
  +     * @param unlessProperty the property to check
        */
       public void setUnless(String unlessProperty) {
           this.unlessProperty = unlessProperty;
  
  
  
  1.9       +42 -24    ant/src/main/org/apache/tools/ant/types/selectors/SelectorContainer.java
  
  Index: SelectorContainer.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/SelectorContainer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SelectorContainer.java	4 Jul 2003 23:18:49 -0000	1.8
  +++ SelectorContainer.java	29 Jul 2003 08:37:18 -0000	1.9
  @@ -71,129 +71,147 @@
        *
        * @return whether any selectors are in this container
        */
  -    public boolean hasSelectors();
  +    boolean hasSelectors();
   
       /**
        * Gives the count of the number of selectors in this container
        *
        * @return the number of selectors in this container
        */
  -    public int selectorCount();
  +    int selectorCount();
   
       /**
        * Returns the set of selectors as an array.
  -     *
  +     * @param p the current project
        * @return an array of selectors in this container
        */
  -    public FileSelector[] getSelectors(Project p);
  +    FileSelector[] getSelectors(Project p);
   
       /**
        * Returns an enumerator for accessing the set of selectors.
        *
        * @return an enumerator that goes through each of the selectors
        */
  -    public Enumeration selectorElements();
  +    Enumeration selectorElements();
   
       /**
        * Add a new selector into this container.
        *
        * @param selector the new selector to add
        */
  -    public void appendSelector(FileSelector selector);
  +    void appendSelector(FileSelector selector);
   
       /* Methods below all add specific selectors */
   
       /**
        * add a "Select" selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addSelector(SelectSelector selector);
  +    void addSelector(SelectSelector selector);
   
       /**
        * add an "And" selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addAnd(AndSelector selector);
  +    void addAnd(AndSelector selector);
   
       /**
        * add an "Or" selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addOr(OrSelector selector);
  +    void addOr(OrSelector selector);
   
       /**
        * add a "Not" selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addNot(NotSelector selector);
  +    void addNot(NotSelector selector);
   
       /**
        * add a "None" selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addNone(NoneSelector selector);
  +    void addNone(NoneSelector selector);
   
       /**
        * add a majority selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addMajority(MajoritySelector selector);
  +    void addMajority(MajoritySelector selector);
   
       /**
        * add a selector date entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addDate(DateSelector selector);
  +    void addDate(DateSelector selector);
   
       /**
        * add a selector size entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addSize(SizeSelector selector);
  +    void addSize(SizeSelector selector);
   
       /**
        * add a selector filename entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addFilename(FilenameSelector selector);
  +    void addFilename(FilenameSelector selector);
   
       /**
        * add an extended selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addCustom(ExtendSelector selector);
  +    void addCustom(ExtendSelector selector);
   
       /**
        * add a contains selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addContains(ContainsSelector selector);
  +    void addContains(ContainsSelector selector);
   
       /**
        * add a present selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addPresent(PresentSelector selector);
  +    void addPresent(PresentSelector selector);
   
       /**
        * add a depth selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addDepth(DepthSelector selector);
  +    void addDepth(DepthSelector selector);
   
       /**
        * add a depends selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addDepend(DependSelector selector);
  +    void addDepend(DependSelector selector);
   
       /**
        * add a regular expression selector entry on the selector list
  +     * @param selector the selector to add
        */
  -    public void addContainsRegexp(ContainsRegexpSelector selector);
  +    void addContainsRegexp(ContainsRegexpSelector selector);
   
       /**
        * add the type selector
  +     * @param selector the selector to add
        * @since ant 1.6
        */
  -    public void addType(TypeSelector selector);
  +    void addType(TypeSelector selector);
   
       /**
        * add the different selector
  +     * @param selector the selector to add
        * @since ant 1.6
        */
  -    public void addDifferent(DifferentSelector selector);
  +    void addDifferent(DifferentSelector selector);
   
       /**
        * add an arbitary selector
  +     * @param selector the selector to add
        * @since Ant 1.6
        */
  -    public void add(FileSelector selector);
  +    void add(FileSelector selector);
   }
   
  
  
  
  1.4       +2 -2      ant/src/main/org/apache/tools/ant/types/selectors/SelectorScanner.java
  
  Index: SelectorScanner.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/SelectorScanner.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SelectorScanner.java	4 Jul 2003 23:18:49 -0000	1.3
  +++ SelectorScanner.java	29 Jul 2003 08:37:18 -0000	1.4
  @@ -73,14 +73,14 @@
        *
        * @return list of directories not selected
        */
  -    public String[] getDeselectedDirectories();
  +    String[] getDeselectedDirectories();
   
       /**
        * Files which were selected out of a scan.
        *
        * @return list of files not selected
        */
  -    public String[] getDeselectedFiles();
  +    String[] getDeselectedFiles();
   
   
   }
  
  
  
  1.16      +1 -1      ant/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java
  
  Index: SelectorUtils.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SelectorUtils.java	19 Jul 2003 11:20:22 -0000	1.15
  +++ SelectorUtils.java	29 Jul 2003 08:37:18 -0000	1.16
  @@ -674,7 +674,7 @@
   
       /**
        * removes from a pattern all tokens to the right containing wildcards
  -     * @param input
  +     * @param input the input string
        * @return the leftmost part of the pattern without wildcards
        */
       public static String rtrimWildcardTokens(String input) {
  
  
  
  1.6       +19 -3     ant/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java
  
  Index: SizeSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/SizeSelector.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SizeSelector.java	4 Jul 2003 23:18:49 -0000	1.5
  +++ SizeSelector.java	29 Jul 2003 08:37:18 -0000	1.6
  @@ -71,13 +71,23 @@
       private long multiplier = 1;
       private long sizelimit = -1;
       private int cmp = 2;
  -    public final static String SIZE_KEY = "value";
  -    public final static String UNITS_KEY = "units";
  -    public final static String WHEN_KEY = "when";
  +    /** Used for parameterized custom selector */
  +    public static final String SIZE_KEY = "value";
  +    /** Used for parameterized custom selector */
  +    public static final String UNITS_KEY = "units";
  +    /** Used for parameterized custom selector */
  +    public static final String WHEN_KEY = "when";
   
  +    /**
  +     * Creates a new <code>SizeSelector</code> instance.
  +     *
  +     */
       public SizeSelector() {
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer("{sizeselector value: ");
           buf.append(sizelimit);
  @@ -270,6 +280,9 @@
        * standard. It disambiguates things for us, though.
        */
       public static class ByteUnits extends EnumeratedAttribute {
  +        /**
  +         * @return the values as an array of strings
  +         */
           public String[] getValues() {
               return new String[]{"K", "k", "kilo", "KILO",
                                   "Ki", "KI", "ki", "kibi", "KIBI",
  @@ -287,6 +300,9 @@
        * Enumerated attribute with the values for size comparison.
        */
       public static class SizeComparisons extends EnumeratedAttribute {
  +        /**
  +         * @return the values as an array of strings
  +         */
           public String[] getValues() {
               return new String[]{"less", "more", "equal"};
           }
  
  
  
  1.5       +15 -1     ant/src/main/org/apache/tools/ant/types/selectors/TypeSelector.java
  
  Index: TypeSelector.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/TypeSelector.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TypeSelector.java	4 Jul 2003 23:18:49 -0000	1.4
  +++ TypeSelector.java	29 Jul 2003 08:37:18 -0000	1.5
  @@ -69,11 +69,19 @@
   
       private String type = null;
   
  -    public final static String TYPE_KEY = "type";
  +    /** Key to used for parameterized custom selector */
  +    public static final String TYPE_KEY = "type";
   
  +    /**
  +     * Creates a new <code>TypeSelector</code> instance.
  +     *
  +     */
       public TypeSelector() {
       }
   
  +    /**
  +     * @return a string describing this object
  +     */
       public String toString() {
           StringBuffer buf = new StringBuffer("{typeselector type: ");
           buf.append(type);
  @@ -83,6 +91,7 @@
   
       /**
        * Set the type of file to require.
  +     * @param fileTypes the type of file - file or dir
        */
       public void setType(FileType fileTypes) {
           this.type = fileTypes.getValue();
  @@ -146,9 +155,14 @@
        * Enumerated attribute with the values for types of file
        */
       public static class FileType extends EnumeratedAttribute {
  +        /** the string value for file */
           public static final String FILE = "file";
  +        /** the string value for dir */
           public static final String DIR = "dir";
   
  +        /**
  +         * @return the values as an array of strings
  +         */
           public String[] getValues() {
               return new String[]{FILE, DIR};
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message