KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > filters > BaseParamFilterReader


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */

18 package org.apache.tools.ant.filters;
19
20 import java.io.Reader JavaDoc;
21 import org.apache.tools.ant.types.Parameter;
22 import org.apache.tools.ant.types.Parameterizable;
23
24 /**
25  * Parameterized base class for core filter readers.
26  *
27  */

28 public abstract class BaseParamFilterReader
29     extends BaseFilterReader
30     implements Parameterizable {
31     /** The passed in parameter array. */
32     private Parameter[] parameters;
33
34     /**
35      * Constructor for "dummy" instances.
36      *
37      * @see BaseFilterReader#BaseFilterReader()
38      */

39     public BaseParamFilterReader() {
40         super();
41     }
42
43     /**
44      * Creates a new filtered reader.
45      *
46      * @param in A Reader object providing the underlying stream.
47      * Must not be <code>null</code>.
48      */

49     public BaseParamFilterReader(final Reader JavaDoc in) {
50         super(in);
51     }
52
53     /**
54      * Sets the parameters used by this filter, and sets
55      * the filter to an uninitialized status.
56      *
57      * @param parameters The parameters to be used by this filter.
58      * Should not be <code>null</code>.
59      */

60     public final void setParameters(final Parameter[] parameters) {
61         this.parameters = parameters;
62         setInitialized(false);
63     }
64
65     /**
66      * Returns the parameters to be used by this filter.
67      *
68      * @return the parameters to be used by this filter
69      */

70     protected final Parameter[] getParameters() {
71         return parameters;
72     }
73 }
74
Popular Tags