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: package org.apache.cocoon.components;
18:
19: import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
20: import org.apache.avalon.framework.configuration.DefaultConfiguration;
21: import org.apache.avalon.framework.logger.Logger;
22: import org.apache.cocoon.util.Settings;
23:
24: /**
25: * Property Aware SAX Configuration Handler.
26: * This component extends the {@link SAXConfigurationHandler}
27: * by creating configurations that can contain placeholders for System Properties.
28: *
29: * @version SVN $Id: $
30: */
31: public class PropertyAwareSAXConfigurationHandler extends
32: SAXConfigurationHandler {
33:
34: private Settings settings;
35: private Logger logger;
36:
37: /**
38: * Constructor
39: * @param settings The Settings to use when processing the configuration
40: */
41: public PropertyAwareSAXConfigurationHandler(Settings settings,
42: Logger logger) {
43: super ();
44: this .settings = settings;
45: this .logger = logger;
46: }
47:
48: /**
49: * Create a new <code>PropertyAwareConfiguration</code> with the specified
50: * local name and location.
51: *
52: * @param localName a <code>String</code> value
53: * @param location a <code>String</code> value
54: * @return a <code>DefaultConfiguration</code> value
55: */
56: protected DefaultConfiguration createConfiguration(
57: final String localName, final String location) {
58: return new PropertyAwareConfiguration(localName, location,
59: this.settings, this.logger);
60: }
61: }
|