Source Code Cross Referenced for PropertyAwareConfiguration.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » components » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » apache lenya 2.0 » org.apache.cocoon.components 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.cocoon.components;
018:
019:        import org.apache.avalon.framework.configuration.DefaultConfiguration;
020:        import org.apache.avalon.framework.configuration.ConfigurationException;
021:        import org.apache.avalon.framework.configuration.Configuration;
022:        import org.apache.avalon.framework.logger.Logger;
023:        import org.apache.cocoon.util.SettingsHelper;
024:        import org.apache.cocoon.util.Settings;
025:
026:        /**
027:         * Property Aware Configuration.
028:         * This component extends the {@link DefaultConfiguration}
029:         * by suppporting configurations that can contain placeholders for System Properties.
030:         *
031:         * @version SVN $Id: $
032:         */
033:        public class PropertyAwareConfiguration extends DefaultConfiguration {
034:            private Settings settings;
035:            private Logger logger;
036:
037:            /**
038:             * Copy constructor, to create a clone of another configuration.
039:             * To modify children, use <code>getChild()</code>,
040:             * <code>removeChild()</code> and <code>addChild()</code>.
041:             *
042:             * @param config   the <code>Configuration</code> to copy
043:             * @param deepCopy true will cause clones of the children to be added,
044:             *                 false will add the original instances and is thus
045:             *                 faster.
046:             * @param settings The Settings to use when resolving tokens
047:             * @param logger   A Logger to use
048:             * @throws ConfigurationException if an error occurs when copying
049:             */
050:            public PropertyAwareConfiguration(Configuration config,
051:                    boolean deepCopy, Settings settings, Logger logger)
052:                    throws ConfigurationException {
053:                super (config, deepCopy);
054:                this .settings = settings;
055:                this .logger = logger;
056:            }
057:
058:            /**
059:             * Shallow copy constructor, suitable for craeting a writable clone of
060:             * a read-only configuration. To modify children, use <code>getChild()</code>,
061:             * <code>removeChild()</code> and <code>addChild()</code>.
062:             *
063:             * @param config the <code>Configuration</code> to copy
064:             * @param settings The Settings to use when resolving tokens
065:             * @param logger A Logger to use
066:             * @throws ConfigurationException if an error occurs when copying
067:             */
068:            public PropertyAwareConfiguration(Configuration config,
069:                    Settings settings, Logger logger)
070:                    throws ConfigurationException {
071:                super (config);
072:                this .settings = settings;
073:                this .logger = logger;
074:            }
075:
076:            /**
077:             * Create a new <code>DefaultConfiguration</code> instance.
078:             *
079:             * @param name a <code>String</code> value
080:             */
081:            public PropertyAwareConfiguration(final String name,
082:                    Settings settings, Logger logger) {
083:                super (name);
084:                this .settings = settings;
085:                this .logger = logger;
086:            }
087:
088:            /**
089:             * Create a new <code>DefaultConfiguration</code> instance.
090:             *
091:             * @param name     a <code>String</code> value
092:             * @param location a <code>String</code> value
093:             * @param settings The Settings to use when resolving tokens
094:             * @param logger A Logger to use
095:             */
096:            public PropertyAwareConfiguration(final String name,
097:                    final String location, Settings settings, Logger logger) {
098:                super (name, location);
099:                this .settings = settings;
100:                this .logger = logger;
101:            }
102:
103:            /**
104:             * Create a new <code>DefaultConfiguration</code> instance.
105:             *
106:             * @param name     config node name
107:             * @param location Builder-specific locator string
108:             * @param ns       Namespace string (typically a URI). Should not be null; use ""
109:             *                 if no namespace.
110:             * @param prefix   A short string prefixed to element names, associating
111:             *                 elements with a longer namespace string. Should not be null; use "" if no
112:             *                 namespace.
113:             * @param settings The Settings to use when resolving tokens
114:             * @param logger A Logger to use
115:             */
116:            public PropertyAwareConfiguration(final String name,
117:                    final String location, final String ns,
118:                    final String prefix, Settings settings, Logger logger) {
119:                super (name, location, ns, prefix);
120:                this .settings = settings;
121:                this .logger = logger;
122:            }
123:
124:            /**
125:             * Create a new <code>DefaultConfiguration</code> instance.
126:             *
127:             * @param config   A DefaultConfiguration
128:             * @param settings The Settings to use when resolving tokens
129:             * @param logger A Logger to use
130:             */
131:            public PropertyAwareConfiguration(
132:                    final DefaultConfiguration config, Settings settings,
133:                    Logger logger) throws ConfigurationException {
134:                super (config, false);
135:                this .settings = settings;
136:                this .logger = logger;
137:            }
138:
139:            /**
140:             * Set the value of this <code>Configuration</code> object to the specified string.
141:             *
142:             * @param value a <code>String</code> value
143:             */
144:            public void setValue(final String value) {
145:                super .setValue(SettingsHelper.replace(value, this .settings,
146:                        this .logger));
147:            }
148:
149:            /**
150:             * Set the value of the specified attribute to the specified string.
151:             *
152:             * @param name  name of the attribute to set
153:             * @param value a <code>String</code> value
154:             */
155:            public void setAttribute(final String name, final String value) {
156:                super.setAttribute(name, SettingsHelper.replace(value,
157:                        this.settings, this.logger));
158:            }
159:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.