ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional PropertyFile.java RenameExtensions.java ReplaceRegExp.java
Date Sun, 23 Jun 2002 19:47:19 GMT
stevel      2002/06/23 12:47:19

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional Tag:
                        ANT_15_BRANCH PropertyFile.java
                        RenameExtensions.java ReplaceRegExp.java
  Log:
  javadoc commentary
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.21.2.2  +51 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
  
  Index: PropertyFile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java,v
  retrieving revision 1.21.2.1
  retrieving revision 1.21.2.2
  diff -u -r1.21.2.1 -r1.21.2.2
  --- PropertyFile.java	28 May 2002 20:44:48 -0000	1.21.2.1
  +++ PropertyFile.java	23 Jun 2002 19:47:19 -0000	1.21.2.2
  @@ -240,10 +240,16 @@
           }
       }
   
  +    /**
  +     * Location of the property file to be edited; required.
  +     */
       public void setFile(File file) {
           propertyfile = file;
       }
   
  +    /**
  +     * optional header comment for the file
  +     */
       public void setComment(String hdr) {
           comment = hdr;
       }
  @@ -308,27 +314,69 @@
           private String              pattern = null;
           private int                 field = Calendar.DATE;
   
  +        /**
  +         * Name of the property name/value pair
  +         */
           public void setKey(String value) {
               this.key = value;
           }
  +        
  +        /** 
  +         * Value to set (=), to add (+) or subtract (-)
  +         */
           public void setValue(String value) {
               this.value = value;
           }
  +        
  +        /**
  +         * operation to apply. 
  +         * "+" or "=" 
  +         *(default) for all datatypes; "-" for date and int only)\.
  +         */
           public void setOperation(Operation value) {
               this.operation = Operation.toOperation(value.getValue());
           }
  +        
  +        /**
  +         * Regard the value as : int, date or string (default)
  +         */
           public void setType(Type value) {
               this.type = Type.toType(value.getValue());
           }
  +        
  +        /**
  +         * Initial value to set for a property if it is not
  +         * already defined in the property file.
  +         * For type date, an additional keyword is allowed: "now"
  +         */
  +                     
           public void setDefault(String value) {
               this.defaultValue = value;
           }
  +        
  +        /**
  +         * For int and date type only. If present, Values will
  +         * be parsed and formatted accordingly.
  +         */
           public void setPattern(String value) {
               this.pattern = value;
           }
           
           /**
  -         * @since 1.15, Ant 1.5
  +         * The unit of the value to be applied to date +/- operations.
  +         *            Valid Values are:
  +         *            <ul>
  +         *               <li>millisecond</li>
  +         *               <li>second</li>
  +         *               <li>minute</li>
  +         *               <li>hour</li>
  +         *               <li>day (default)</li>
  +         *               <li>week</li>
  +         *               <li>month</li>
  +         *               <li>year</li>
  +         *            </ul>
  +         *            This only applies to date types using a +/- operation.        
  +         * @since Ant 1.5
            */
           public void setUnit(PropertyFile.Unit unit) {
               field = unit.getCalendarField();
  @@ -598,8 +646,8 @@
       
       /**
        * Borrowed from Tstamp
  -     *
  -     * @since 1.15, Ant 1.5
  +     * @todo share all this time stuff across many tasks as a datetime datatype
  +     * @since Ant 1.5
        */
       public static class Unit extends EnumeratedAttribute {
   
  
  
  
  1.15.2.1  +7 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java
  
  Index: RenameExtensions.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- RenameExtensions.java	14 Apr 2002 11:16:16 -0000	1.15
  +++ RenameExtensions.java	23 Jun 2002 19:47:19 -0000	1.15.2.1
  @@ -97,12 +97,17 @@
           globType.setValue("glob");
       }
   
  -    /** store fromExtension **/
  +    /**
  +     * The string that files must end in to be renamed
  +     **/
       public void setFromExtension(String from) {
           fromExtension = from;
       }
   
  -    /** store toExtension **/
  +    /** 
  +     * The string that renamed files will end with on
  +     * completion
  +     */
       public void setToExtension(String to) {
           toExtension = to;
       }
  
  
  
  1.9.2.4   +45 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
  
  Index: ReplaceRegExp.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java,v
  retrieving revision 1.9.2.3
  retrieving revision 1.9.2.4
  diff -u -r1.9.2.3 -r1.9.2.4
  --- ReplaceRegExp.java	27 May 2002 15:57:40 -0000	1.9.2.3
  +++ ReplaceRegExp.java	23 Jun 2002 19:47:19 -0000	1.9.2.4
  @@ -169,11 +169,19 @@
       }
   
   
  +    /**
  +     * file for which the regular expression should be replaced;
  +     * required unless a nested fileset is supplied.
  +     */
       public void setFile(File file) {
           this.file = file;
       }
   
   
  +    /**
  +     * the regular expression pattern to match in the file(s);
  +     * required if no nested &lt;regexp&gt; is used
  +     */
       public void setMatch(String match) {
           if (regex != null) {
               throw new BuildException("Only one regular expression is allowed");
  @@ -184,6 +192,12 @@
       }
   
   
  +    /**
  +     * The substitution pattern to place in the file(s) in place
  +     * of the regular expression.
  +     * Required if no nested &lt;substitution&gt; is used
  +     */
  +                     
       public void setReplace(String replace) {
           if (subs != null) {
               throw new BuildException("Only one substitution expression is "
  @@ -194,12 +208,30 @@
           subs.setExpression(replace);
       }
   
  -
  +    /**
  +     * The flags to use when matching the regular expression.  For more
  +     * information, consult the Perl5 syntax.
  +     * <ul>
  +     *  <li>g : Global replacement.  Replace all occurences found
  +     *  <li>i : Case Insensitive.  Do not consider case in the match
  +     *  <li>m : Multiline.  Treat the string as multiple lines of input, 
  +     *         using "^" and "$" as the start or end of any line, respectively, rather
than start or end of string.
  +     *  <li> s : Singleline.  Treat the string as a single line of input, using
  +     *        "." to match any character, including a newline, which normally, it would
not match.
  +     *</ul>
  +     */                     
       public void setFlags(String flags) {
           this.flags = flags;
       }
   
   
  +    /**
  +     * Process the file(s) one line at a time, executing the replacement
  +     * on one line at a time.  This is useful if you
  +     * want to only replace the first occurence of a regular expression on
  +     * each line, which is not easy to do when processing the file as a whole.
  +     * Defaults to <i>false</i>.</td>
  +     */
       public void setByLine(String byline) {
           Boolean res = Boolean.valueOf(byline);
   
  @@ -210,11 +242,19 @@
       }
   
   
  +    /**
  +     * list files to apply the replacement to
  +     */
       public void addFileset(FileSet set) {
           filesets.addElement(set);
       }
   
   
  +    /**
  +     * A regular expression.
  +     * You can use this element to refer to a previously
  +     * defined regular expression datatype instance
  +     */
       public RegularExpression createRegexp() {
           if (regex != null) {
               throw new BuildException("Only one regular expression is allowed.");
  @@ -225,6 +265,10 @@
       }
   
   
  +    /**
  +     * A substitution pattern.  You can use this element to refer to a previously
  +     * defined substitution pattern datatype instance.
  +     */
       public Substitution createSubstitution() {
           if (subs != null) {
               throw new BuildException("Only one substitution expression is "
  
  
  

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


Mime
View raw message