diff --git a/proposal/sandbox/filterreaders/README b/proposal/sandbox/filterreaders/README
index 409dd2349..90c268b0c 100644
--- a/proposal/sandbox/filterreaders/README
+++ b/proposal/sandbox/filterreaders/README
@@ -20,13 +20,17 @@ Usecase:
Design:
======
-* FilterReaderSet is a collection of 'AntFilterReader's
+* FilterChain is an ordered collection of 'AntFilterReader's and
+ 'java.io.FilterReader's
* Each AntFilterReader encloses the custom class representing
the actual java.io.FilterReader and contains configuration
parameters that may be used by the custom class if it
implements the org.apache.tools.ant.types.Parameterizable
interface.
+
+* For ease of use, Ant's core filter readers can
+ be used with a filter reader specific syntax also.
* Custom filter readers can be created easily even
without using any of Ant's API - all one needs to
@@ -44,14 +48,14 @@ Example:
=======
<loadfile property="mail.recipients" srcFile="recipientlist.txt"> - <filterreaderset> - <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks" /> - </filterreaderset> + <filterchain> + <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks" /> + </filterchaint> </loadfile>Load a property which can be used as a parameter for another task (in this case mail), diff --git a/proposal/sandbox/filterreaders/docs/manual/CoreTypes/filterreaderset.html b/proposal/sandbox/filterreaders/docs/manual/CoreTypes/filterreaderset.html deleted file mode 100644 index 67bffd3c7..000000000 --- a/proposal/sandbox/filterreaders/docs/manual/CoreTypes/filterreaderset.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - -
FilterReaderSets are groups of FilterReaders. FilterReaderSets can appear
-inside tasks that support this feature.
FilterReaderSets are used for
-filtering file contents read in by tasks like LoadFile, etc.
-
-Each FilterReaderSet is composed of nested FilterReader elements.
-
-
Attribute | -Description | -Required | -
classname | -The class name of the filter reader. | -Yes | -
-The following FilterReaders are supplied with the default -distribution. - -
Parameter Name | -Parameter Value | -Required | -
linebreaks | -Characters that are to - be stripped out. Defaults to "\r\n" | -No | -
-
- -This treats the '(' and ')' characters as line break characters and -strips them. --<loadfile srcfile="${src.file}" property="${src.file.contents}"> - <filterreaderset> - <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"/> - </filterreaderset> -</loadfile> -
- --<loadfile srcfile="${src.file}" property="${src.file.contents}"> - <filterreaderset> - <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"> - <param name="linebreaks" value="()"/> - </filterreader> - </filterreaderset> -</loadfile> -
-
- --<loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}"> - <filterreaderset> - <filterreader classname="org.apache.tools.ant.filters.StripJavaComments"/> - </filterreaderset> -</loadfile> -
Parameter Type | -Parameter Name | -Parameter Value | -Required | -
tokenchar | -begintoken | -Character marking the - beginning of a token. Defaults to @ | -No | -
tokenchar | -endtoken | -Character marking the - end of a token. Defaults to @ | -No | -
token | -User defined String. | -User defined search String | -Yes | -
- -
- --<tstamp/> -<loadfile srcfile="${src.file}" property="${src.file.replaced}"> - <filterreaderset> - <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens"> - <param type="token" name="DATE" value="${TODAY}"/> - <filterreader/> - </filterreaderset> -</loadfile> -
Parameter Name | -Parameter Value | -Required | -
lines | -Number of lines to be read. - Defaults to "10" | -No | -
-
- --<loadfile srcfile="${src.file}" property="${src.file.head}"> - <filterreaderset> - <filterreader classname="org.apache.tools.ant.filters.HeadFilter"> - <param name="lines" value="15"/> - </filterreader> - </filterreaderset> -</loadfile> -
Parameter Name | -Parameter Value | -Required | -
lines | -Number of lines to be read. - Defaults to "10" | -No | -
-
- -This stores the last 5 lines of the first 15 lines of the supplied -data in the property ${src.file.mid} --<loadfile srcfile="${src.file}" property="${src.file.tail}"> - <filterreaderset> - <filterreader classname="org.apache.tools.ant.filters.TailFilter"> - <param name="lines" value="15"/> - </filterreader> - </filterreaderset> -</loadfile> -
- --<loadfile srcfile="${src.file}" property="${src.file.mid}"> - <filterreaderset> - <filterreader classname="org.apache.tools.ant.filters.HeadFilter"> - <param name="lines" value="15"/> - </filterreader> - <filterreader classname="org.apache.tools.ant.filters.TailFilter"> - <param name="lines" value="5"/> - </filterreader> - </filterreaderset> -</loadfile> -
Copyright © 2002 Apache Software Foundation. All rights -Reserved.
diff --git a/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadFile.java b/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadFile.java index e8578acfb..ca569c691 100644 --- a/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadFile.java +++ b/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadFile.java @@ -56,7 +56,7 @@ package org.apache.tools.ant.taskdefs; import org.apache.tools.ant.Task; import org.apache.tools.ant.Project; import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.types.FilterReaderSet; +import org.apache.tools.ant.types.FilterChain; import org.apache.tools.ant.util.ChainReaderHelper; import java.io.*; @@ -98,9 +98,9 @@ public final class LoadFile extends Task { private boolean evaluateProperties=false; /** - * Holds filterReaderSets + * Holds FilterChains */ - private final Vector filterReaderSets = new Vector(); + private final Vector filterChains = new Vector(); /** * Encoding to use for filenames, defaults to the platform's default @@ -193,7 +193,7 @@ public final class LoadFile extends Task { ChainReaderHelper crh = new ChainReaderHelper(); crh.setBufferSize(size); crh.setPrimaryReader(instream); - crh.setFilterReaderSets(filterReaderSets); + crh.setFilterChains(filterChains); String text = crh.processStream(); @@ -231,10 +231,10 @@ public final class LoadFile extends Task { } /** - * Add the FilterReaderSet element. + * Add the FilterChain element. */ - public final void addFilterReaderSet(FilterReaderSet filter) { - filterReaderSets.addElement(filter); + public final void addFilterChain(FilterChain filter) { + filterChains.addElement(filter); } //end class diff --git a/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java b/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java index 3946aabd6..b7251fa2d 100644 --- a/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java +++ b/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java @@ -56,7 +56,7 @@ package org.apache.tools.ant.taskdefs; import org.apache.tools.ant.Task; import org.apache.tools.ant.Project; import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.types.FilterReaderSet; +import org.apache.tools.ant.types.FilterChain; import org.apache.tools.ant.util.ChainReaderHelper; import java.io.*; @@ -76,9 +76,9 @@ public final class LoadProperties extends Task { private File srcFile = null; /** - * Holds filterReaderSets + * Holds filterchains */ - private final Vector filterReaderSets = new Vector(); + private final Vector filterChains = new Vector(); /** * Sets the srcfile attribute. @@ -124,7 +124,7 @@ public final class LoadProperties extends Task { ChainReaderHelper crh = new ChainReaderHelper(); crh.setBufferSize(size); crh.setPrimaryReader(instream); - crh.setFilterReaderSets(filterReaderSets); + crh.setFilterChains(filterChains); String text = crh.processStream(); if (!text.endsWith("\n")) { @@ -186,10 +186,10 @@ public final class LoadProperties extends Task { } /** - * Add the FilterReaderSet element. + * Add the FilterChain element. */ - public final void addFilterReaderSet(FilterReaderSet filter) { - filterReaderSets.addElement(filter); + public final void addFilterChain(FilterChain filter) { + filterChains.addElement(filter); } //end class diff --git a/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/types/FilterReaderSet.java b/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/types/FilterReaderSet.java deleted file mode 100644 index 2d3108a01..000000000 --- a/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/types/FilterReaderSet.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowlegement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowlegement may appear in the software itself, - * if and wherever such third-party acknowlegements normally appear. - * - * 4. The names "The Jakarta Project", "Ant", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Group. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - *