01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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;
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 extends BaseFilterReader
29: implements Parameterizable {
30: /** The passed in parameter array. */
31: private Parameter[] parameters;
32:
33: /**
34: * Constructor for "dummy" instances.
35: *
36: * @see BaseFilterReader#BaseFilterReader()
37: */
38: public BaseParamFilterReader() {
39: super ();
40: }
41:
42: /**
43: * Creates a new filtered reader.
44: *
45: * @param in A Reader object providing the underlying stream.
46: * Must not be <code>null</code>.
47: */
48: public BaseParamFilterReader(final Reader in) {
49: super (in);
50: }
51:
52: /**
53: * Sets the parameters used by this filter, and sets
54: * the filter to an uninitialized status.
55: *
56: * @param parameters The parameters to be used by this filter.
57: * Should not be <code>null</code>.
58: */
59: public final void setParameters(final Parameter[] parameters) {
60: this .parameters = parameters;
61: setInitialized(false);
62: }
63:
64: /**
65: * Returns the parameters to be used by this filter.
66: *
67: * @return the parameters to be used by this filter
68: */
69: protected final Parameter[] getParameters() {
70: return parameters;
71: }
72: }
|