ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r897758 - in /ant/core/trunk: ./ docs/manual/CoreTypes/ src/main/org/apache/tools/ant/filters/ src/main/org/apache/tools/ant/types/ src/tests/antunit/filters/
Date Mon, 11 Jan 2010 05:36:55 GMT
Author: bodewig
Date: Mon Jan 11 05:36:55 2010
New Revision: 897758

URL: http://svn.apache.org/viewvc?rev=897758&view=rev
Log:
appendtolines -> suffixlines

Added:
    ant/core/trunk/src/main/org/apache/tools/ant/filters/SuffixLines.java
      - copied, changed from r897756, ant/core/trunk/src/main/org/apache/tools/ant/filters/AppendToLines.java
    ant/core/trunk/src/tests/antunit/filters/suffix-test.xml   (contents, props changed)
      - copied, changed from r897756, ant/core/trunk/src/tests/antunit/filters/append-test.xml
Removed:
    ant/core/trunk/src/main/org/apache/tools/ant/filters/AppendToLines.java
    ant/core/trunk/src/tests/antunit/filters/append-test.xml
Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/docs/manual/CoreTypes/filterchain.html
    ant/core/trunk/src/main/org/apache/tools/ant/types/FilterChain.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=897758&r1=897757&r2=897758&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Jan 11 05:36:55 2010
@@ -4,6 +4,8 @@
 Changes that could break older environments:
 -------------------------------------------
 
+ * the appendtolines filter has been renamed to suffixlines.
+
 Fixed bugs:
 -----------
 

Modified: ant/core/trunk/docs/manual/CoreTypes/filterchain.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/filterchain.html?rev=897758&r1=897757&r2=897758&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTypes/filterchain.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/filterchain.html Mon Jan 11 05:36:55 2010
@@ -107,7 +107,6 @@
 A FilterChain is formed by defining zero or more of the following
 nested elements.<br>
 <a href="#filterreader">FilterReader</a><br>
-<a href="#appendtolines">AppendToLines</a><br>
 <a href="#classconstants">ClassConstants</a><br>
 <a href="#escapeunicode">EscapeUnicode</a><br>
 <a href="#expandproperties">ExpandProperties</a><br>
@@ -119,6 +118,7 @@
 <a href="#stripjavacomments">StripJavaComments</a><br>
 <a href="#striplinebreaks">StripLineBreaks</a><br>
 <a href="#striplinecomments">StripLineComments</a><br>
+<a href="#suffixlines">SuffixLines</a><br>
 <a href="#tabstospaces">TabsToSpaces</a><br>
 <a href="#tailfilter">TailFilter</a><br>
 <a href="#deletecharacters">DeleteCharacters</a><br>
@@ -479,9 +479,9 @@
 &lt;prefixlines prefix=&quot;Foo&quot;/&gt;
 </pre></blockquote>
 
-<h3><a name="appendtolines">AppendToLines</a></h3>
+<h3><a name="suffixlines">SuffixLines</a></h3>
 
-Attaches an appendix to every line.
+Attaches a suffix to every line.
 
 <p><em>since Ant 1.8.0</em></p>
 
@@ -492,24 +492,24 @@
     <td vAlign=top align="center"><b>Required</b></td>
   </tr>
   <tr>
-    <td vAlign=top>append</td>
-    <td vAlign=top align="center">Appendix to be attached to lines.</td>
+    <td vAlign=top>suffix</td>
+    <td vAlign=top align="center">Suffix to be attached to lines.</td>
     <td vAlign=top align="center">Yes</td>
   </tr>
 </table>
 <p>
 <h4>Example:</h4>
 
-This will attach the appendix <code>Foo</code> to all lines.
+This will attach the suffix <code>Foo</code> to all lines.
 <blockquote><pre>
-&lt;filterreader classname=&quot;org.apache.tools.ant.filters.AppendToLines&quot;&gt;
-  &lt;param name=&quot;append&quot; value=&quot;Foo&quot;/&gt;
+&lt;filterreader classname=&quot;org.apache.tools.ant.filters.SuffixLines&quot;&gt;
+  &lt;param name=&quot;suffix&quot; value=&quot;Foo&quot;/&gt;
 &lt;/filterreader&gt;
 </pre></blockquote>
 
 Convenience method:
 <blockquote><pre>
-&lt;appendtolines append=&quot;Foo&quot;/&gt;
+&lt;suffixlines suffix=&quot;Foo&quot;/&gt;
 </pre></blockquote>
 
 <h3><a name="replacetokens">ReplaceTokens</a></h3>

Copied: ant/core/trunk/src/main/org/apache/tools/ant/filters/SuffixLines.java (from r897756,
ant/core/trunk/src/main/org/apache/tools/ant/filters/AppendToLines.java)
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/filters/SuffixLines.java?p2=ant/core/trunk/src/main/org/apache/tools/ant/filters/SuffixLines.java&p1=ant/core/trunk/src/main/org/apache/tools/ant/filters/AppendToLines.java&r1=897756&r2=897758&rev=897758&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/filters/AppendToLines.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/filters/SuffixLines.java Mon Jan 11 05:36:55
2010
@@ -25,24 +25,24 @@
  * Attaches a suffix to every line.
  *
  * Example:
- * <pre>&lt;appendtolines append=&quot;Foo&quot;/&gt;</pre>
+ * <pre>&lt;suffixlines suffix=&quot;Foo&quot;/&gt;</pre>
  *
  * Or:
  *
- * <pre>&lt;filterreader classname=&quot;org.apache.tools.ant.filters.AppendToLines&quot;&gt;
- *  &lt;param name=&quot;append&quot; value=&quot;Foo&quot;/&gt;
+ * <pre>&lt;filterreader classname=&quot;org.apache.tools.ant.filters.SuffixLines&quot;&gt;
+ *  &lt;param name=&quot;suffix&quot; value=&quot;Foo&quot;/&gt;
  * &lt;/filterreader&gt;</pre>
  *
  * @since Ant 1.8.0
  */
-public final class AppendToLines
+public final class SuffixLines
     extends BaseParamFilterReader
     implements ChainableReader {
     /** Parameter name for the prefix. */
-    private static final String APPEND_KEY = "append";
+    private static final String SUFFIX_KEY = "suffix";
 
-    /** The appendix to be used. */
-    private String append = null;
+    /** The suffix to be used. */
+    private String suffix = null;
 
     /** Data that must be read from, if not null. */
     private String queuedData = null;
@@ -52,7 +52,7 @@
      *
      * @see BaseFilterReader#BaseFilterReader()
      */
-    public AppendToLines() {
+    public SuffixLines() {
         super();
     }
 
@@ -62,13 +62,13 @@
      * @param in A Reader object providing the underlying stream.
      *           Must not be <code>null</code>.
      */
-    public AppendToLines(final Reader in) {
+    public SuffixLines(final Reader in) {
         super(in);
     }
 
     /**
      * Returns the next character in the filtered stream. One line is read
-     * from the original input, and the appendix added. The resulting
+     * from the original input, and the suffix added. The resulting
      * line is then used until it ends, at which point the next original line
      * is read, etc.
      *
@@ -101,7 +101,7 @@
             if (queuedData == null) {
                 ch = -1;
             } else {
-                if (append != null) {
+                if (suffix != null) {
                     String lf = "";
                     if (queuedData.endsWith("\r\n")) {
                         lf = "\r\n";
@@ -111,7 +111,7 @@
                     queuedData =
                         queuedData.substring(0,
                                              queuedData.length() - lf.length())
-                        + append + lf;
+                        + suffix + lf;
                 }
                 return read();
             }
@@ -120,27 +120,27 @@
     }
 
     /**
-     * Sets the appendix to add at the end of each input line.
+     * Sets the suffix to add at the end of each input line.
      *
-     * @param append The appendix to add at the end of each input line.
-     *               May be <code>null</code>, in which case no appendix
+     * @param suffix The suffix to add at the end of each input line.
+     *               May be <code>null</code>, in which case no suffix
      *               is added.
      */
-    public void setAppend(final String append) {
-        this.append = append;
+    public void setSuffix(final String append) {
+        this.suffix = append;
     }
 
     /**
-     * Returns the appendix which will be added at the end of each input line.
+     * Returns the suffix which will be added at the end of each input line.
      *
-     * @return the appendix which will be added at the end of each input line
+     * @return the suffix which will be added at the end of each input line
      */
-    private String getAppend() {
-        return append;
+    private String getSuffix() {
+        return suffix;
     }
 
     /**
-     * Creates a new AppendToLines filter using the passed in
+     * Creates a new SuffixLines filter using the passed in
      * Reader for instantiation.
      *
      * @param rdr A Reader object providing the underlying stream.
@@ -150,21 +150,21 @@
      *         the specified reader
      */
     public Reader chain(final Reader rdr) {
-        AppendToLines newFilter = new AppendToLines(rdr);
-        newFilter.setAppend(getAppend());
+        SuffixLines newFilter = new SuffixLines(rdr);
+        newFilter.setSuffix(getSuffix());
         newFilter.setInitialized(true);
         return newFilter;
     }
 
     /**
-     * Initializes the appendix if it is available from the parameters.
+     * Initializes the suffix if it is available from the parameters.
      */
     private void initialize() {
         Parameter[] params = getParameters();
         if (params != null) {
             for (int i = 0; i < params.length; i++) {
-                if (APPEND_KEY.equals(params[i].getName())) {
-                    append = params[i].getValue();
+                if (SUFFIX_KEY.equals(params[i].getName())) {
+                    suffix = params[i].getValue();
                     break;
                 }
             }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/FilterChain.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/FilterChain.java?rev=897758&r1=897757&r2=897758&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/FilterChain.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/FilterChain.java Mon Jan 11 05:36:55
2010
@@ -23,7 +23,6 @@
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
-import org.apache.tools.ant.filters.AppendToLines;
 import org.apache.tools.ant.filters.ChainableReader;
 import org.apache.tools.ant.filters.ClassConstants;
 import org.apache.tools.ant.filters.EscapeUnicode;
@@ -36,6 +35,7 @@
 import org.apache.tools.ant.filters.StripJavaComments;
 import org.apache.tools.ant.filters.StripLineBreaks;
 import org.apache.tools.ant.filters.StripLineComments;
+import org.apache.tools.ant.filters.SuffixLines;
 import org.apache.tools.ant.filters.TabsToSpaces;
 import org.apache.tools.ant.filters.TailFilter;
 import org.apache.tools.ant.filters.TokenFilter;
@@ -156,17 +156,17 @@
     }
 
     /**
-     * Add a AppendToLines filter.
+     * Add a SuffixLines filter.
      *
-     * @param prefixLines a <code>AppendToLines</code> value
+     * @param suffixLines a <code>SuffixLines</code> value
      * @since Ant 1.8.0
      */
-    public void addAppendToLines(final AppendToLines appendToLines) {
+    public void addSuffixLines(final SuffixLines suffixLines) {
         if (isReference()) {
             throw noChildrenAllowed();
         }
         setChecked(false);
-        filterReaders.addElement(appendToLines);
+        filterReaders.addElement(suffixLines);
     }
 
     /**

Copied: ant/core/trunk/src/tests/antunit/filters/suffix-test.xml (from r897756, ant/core/trunk/src/tests/antunit/filters/append-test.xml)
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/filters/suffix-test.xml?p2=ant/core/trunk/src/tests/antunit/filters/suffix-test.xml&p1=ant/core/trunk/src/tests/antunit/filters/append-test.xml&r1=897756&r2=897758&rev=897758&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/filters/append-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/filters/suffix-test.xml Mon Jan 11 05:36:55 2010
@@ -33,7 +33,7 @@
     <copy todir="${output}">
       <fileset dir="${input}"/>
       <filterchain>
-        <appendtolines append="Foo"/>
+        <suffixlines suffix="Foo"/>
       </filterchain>
     </copy>
     <au:assertFilesMatch expected="${input}/b.txt"

Propchange: ant/core/trunk/src/tests/antunit/filters/suffix-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/core/trunk/src/tests/antunit/filters/suffix-test.xml
------------------------------------------------------------------------------
    svn:mergeinfo = 



Mime
View raw message