KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > ChainedConfiguration


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

16 package org.apache.cocoon.components;
17
18 import org.apache.avalon.framework.configuration.Configuration;
19 import org.apache.avalon.framework.configuration.ConfigurationException;
20
21 /**
22  * This configuration object is used for {@link SitemapConfigurable}
23  * components. It 'extends' {@link Configuration} by a parent.
24  *
25  * @since 2.1
26  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
27  * @version $Id: ChainedConfiguration.java 306633 2005-10-06 13:19:23Z vgritsenko $
28  */

29 public final class ChainedConfiguration implements Configuration {
30
31     private Configuration wrappedConfiguration;
32
33     private ChainedConfiguration parentConfiguration;
34
35     /**
36      * Constructor
37      */

38     public ChainedConfiguration(Configuration wrapped,
39                                  ChainedConfiguration parent) {
40         this.wrappedConfiguration = wrapped;
41         this.parentConfiguration = parent;
42     }
43
44     /**
45      * Get the parent configuration
46      * @return the parent configuration or null.
47      */

48     public ChainedConfiguration getParent() {
49         return this.parentConfiguration;
50     }
51
52     /* (non-Javadoc)
53      * @see org.apache.avalon.framework.configuration.Configuration#getAttribute(java.lang.String, java.lang.String)
54      */

55     public String JavaDoc getAttribute(String JavaDoc arg0, String JavaDoc arg1) {
56         return this.wrappedConfiguration.getAttribute(arg0, arg1);
57     }
58
59     /* (non-Javadoc)
60      * @see org.apache.avalon.framework.configuration.Configuration#getAttribute(java.lang.String)
61      */

62     public String JavaDoc getAttribute(String JavaDoc arg0) throws ConfigurationException {
63         return this.wrappedConfiguration.getAttribute(arg0);
64     }
65
66     /* (non-Javadoc)
67      * @see org.apache.avalon.framework.configuration.Configuration#getAttributeAsBoolean(java.lang.String, boolean)
68      */

69     public boolean getAttributeAsBoolean(String JavaDoc arg0, boolean arg1) {
70         return this.wrappedConfiguration.getAttributeAsBoolean(arg0, arg1);
71     }
72
73     /* (non-Javadoc)
74      * @see org.apache.avalon.framework.configuration.Configuration#getAttributeAsBoolean(java.lang.String)
75      */

76     public boolean getAttributeAsBoolean(String JavaDoc arg0)
77         throws ConfigurationException {
78         return this.wrappedConfiguration.getAttributeAsBoolean(arg0);
79     }
80
81     /* (non-Javadoc)
82      * @see org.apache.avalon.framework.configuration.Configuration#getAttributeAsFloat(java.lang.String, float)
83      */

84     public float getAttributeAsFloat(String JavaDoc arg0, float arg1) {
85         return this.wrappedConfiguration.getAttributeAsFloat(arg0, arg1);
86     }
87
88     /* (non-Javadoc)
89      * @see org.apache.avalon.framework.configuration.Configuration#getAttributeAsFloat(java.lang.String)
90      */

91     public float getAttributeAsFloat(String JavaDoc arg0)
92         throws ConfigurationException {
93         return this.wrappedConfiguration.getAttributeAsFloat(arg0);
94     }
95
96     /* (non-Javadoc)
97      * @see org.apache.avalon.framework.configuration.Configuration#getAttributeAsInteger(java.lang.String, int)
98      */

99     public int getAttributeAsInteger(String JavaDoc arg0, int arg1) {
100         return this.wrappedConfiguration.getAttributeAsInteger(arg0, arg1);
101     }
102
103     /* (non-Javadoc)
104      * @see org.apache.avalon.framework.configuration.Configuration#getAttributeAsInteger(java.lang.String)
105      */

106     public int getAttributeAsInteger(String JavaDoc arg0)
107         throws ConfigurationException {
108         return this.wrappedConfiguration.getAttributeAsInteger(arg0);
109     }
110
111     /* (non-Javadoc)
112      * @see org.apache.avalon.framework.configuration.Configuration#getAttributeAsLong(java.lang.String, long)
113      */

114     public long getAttributeAsLong(String JavaDoc arg0, long arg1) {
115         return this.wrappedConfiguration.getAttributeAsLong(arg0, arg1);
116     }
117
118     /* (non-Javadoc)
119      * @see org.apache.avalon.framework.configuration.Configuration#getAttributeAsLong(java.lang.String)
120      */

121     public long getAttributeAsLong(String JavaDoc arg0) throws ConfigurationException {
122         return this.wrappedConfiguration.getAttributeAsLong(arg0);
123     }
124
125     /* (non-Javadoc)
126      * @see org.apache.avalon.framework.configuration.Configuration#getAttributeNames()
127      */

128     public String JavaDoc[] getAttributeNames() {
129         return this.wrappedConfiguration.getAttributeNames();
130     }
131
132     /* (non-Javadoc)
133      * @see org.apache.avalon.framework.configuration.Configuration#getChild(java.lang.String, boolean)
134      */

135     public Configuration getChild(String JavaDoc arg0, boolean arg1) {
136         return this.wrappedConfiguration.getChild(arg0, arg1);
137     }
138
139     /* (non-Javadoc)
140      * @see org.apache.avalon.framework.configuration.Configuration#getChild(java.lang.String)
141      */

142     public Configuration getChild(String JavaDoc arg0) {
143         return this.wrappedConfiguration.getChild(arg0);
144     }
145
146     /* (non-Javadoc)
147      * @see org.apache.avalon.framework.configuration.Configuration#getChildren()
148      */

149     public Configuration[] getChildren() {
150         return this.wrappedConfiguration.getChildren();
151     }
152
153     /* (non-Javadoc)
154      * @see org.apache.avalon.framework.configuration.Configuration#getChildren(java.lang.String)
155      */

156     public Configuration[] getChildren(String JavaDoc arg0) {
157         return this.wrappedConfiguration.getChildren(arg0);
158     }
159
160     /* (non-Javadoc)
161      * @see org.apache.avalon.framework.configuration.Configuration#getLocation()
162      */

163     public String JavaDoc getLocation() {
164         return this.wrappedConfiguration.getLocation();
165     }
166
167     /* (non-Javadoc)
168      * @see org.apache.avalon.framework.configuration.Configuration#getName()
169      */

170     public String JavaDoc getName() {
171         return this.wrappedConfiguration.getName();
172     }
173
174     /* (non-Javadoc)
175      * @see org.apache.avalon.framework.configuration.Configuration#getNamespace()
176      */

177     public String JavaDoc getNamespace() throws ConfigurationException {
178         return this.wrappedConfiguration.getNamespace();
179     }
180
181     /* (non-Javadoc)
182      * @see org.apache.avalon.framework.configuration.Configuration#getValue()
183      */

184     public String JavaDoc getValue() throws ConfigurationException {
185         return this.wrappedConfiguration.getValue();
186     }
187
188     /* (non-Javadoc)
189      * @see org.apache.avalon.framework.configuration.Configuration#getValue(java.lang.String)
190      */

191     public String JavaDoc getValue(String JavaDoc arg0) {
192         return this.wrappedConfiguration.getValue(arg0);
193     }
194
195     /* (non-Javadoc)
196      * @see org.apache.avalon.framework.configuration.Configuration#getValueAsBoolean()
197      */

198     public boolean getValueAsBoolean() throws ConfigurationException {
199         return this.wrappedConfiguration.getValueAsBoolean();
200     }
201
202     /* (non-Javadoc)
203      * @see org.apache.avalon.framework.configuration.Configuration#getValueAsBoolean(boolean)
204      */

205     public boolean getValueAsBoolean(boolean arg0) {
206         return this.wrappedConfiguration.getValueAsBoolean(arg0);
207     }
208
209     /* (non-Javadoc)
210      * @see org.apache.avalon.framework.configuration.Configuration#getValueAsFloat()
211      */

212     public float getValueAsFloat() throws ConfigurationException {
213         return this.wrappedConfiguration.getValueAsFloat();
214     }
215
216     /* (non-Javadoc)
217      * @see org.apache.avalon.framework.configuration.Configuration#getValueAsFloat(float)
218      */

219     public float getValueAsFloat(float arg0) {
220         return this.wrappedConfiguration.getValueAsFloat(arg0);
221     }
222
223     /* (non-Javadoc)
224      * @see org.apache.avalon.framework.configuration.Configuration#getValueAsInteger()
225      */

226     public int getValueAsInteger() throws ConfigurationException {
227         return this.wrappedConfiguration.getValueAsInteger();
228     }
229
230     /* (non-Javadoc)
231      * @see org.apache.avalon.framework.configuration.Configuration#getValueAsInteger(int)
232      */

233     public int getValueAsInteger(int arg0) {
234         return this.wrappedConfiguration.getValueAsInteger(arg0);
235     }
236
237     /* (non-Javadoc)
238      * @see org.apache.avalon.framework.configuration.Configuration#getValueAsLong()
239      */

240     public long getValueAsLong() throws ConfigurationException {
241         return this.wrappedConfiguration.getValueAsLong();
242     }
243
244     /* (non-Javadoc)
245      * @see org.apache.avalon.framework.configuration.Configuration#getValueAsLong(long)
246      */

247     public long getValueAsLong(long arg0) {
248         return this.wrappedConfiguration.getValueAsLong(arg0);
249     }
250
251     public double getAttributeAsDouble(String JavaDoc name) throws ConfigurationException {
252         return this.wrappedConfiguration.getAttributeAsDouble(name);
253     }
254
255     public double getValueAsDouble() throws ConfigurationException {
256         return this.wrappedConfiguration.getValueAsDouble();
257     }
258
259     public double getValueAsDouble(double value) {
260         return this.wrappedConfiguration.getValueAsDouble(value);
261     }
262
263     public double getAttributeAsDouble(String JavaDoc name, double value) {
264         return this.wrappedConfiguration.getAttributeAsDouble(name, value);
265     }
266 }
267
Popular Tags