Java Doc for ConfigurationFactory.java in  » Library » Apache-commons-configuration-1.4-src » org » apache » commons » configuration » 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 » Library » Apache commons configuration 1.4 src » org.apache.commons.configuration 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.configuration.ConfigurationFactory

ConfigurationFactory
public class ConfigurationFactory (Code)

Factory class to create a CompositeConfiguration from a .xml file using Digester. By default it can handle the Configurations from commons- configuration. If you need to add your own, then you can pass in your own digester rules to use. It is also namespace aware, by providing a digesterRuleNamespaceURI.

Note: Almost all of the features provided by this class and many more are also available for the DefaultConfigurationBuilder class. DefaultConfigurationBuilder also has a more robust merge algorithm for constructing combined configurations. So it is recommended to use this class instead of ConfigurationFactory.


author:
   Eric Pugh
author:
   Henning P. Schmiedehausen
author:
   Oliver Heger
version:
   $Id: ConfigurationFactory.java 524006 2007-03-30 09:33:17Z oheger $

Inner Class :public class DigesterConfigurationFactory extends AbstractObjectCreationFactory
Inner Class :public class FileConfigurationFactory extends DigesterConfigurationFactory
Inner Class :public class PropertiesConfigurationFactory extends FileConfigurationFactory
Inner Class :public class PropertyListConfigurationFactory extends FileConfigurationFactory
Inner Class :public static class AdditionalConfigurationData
Inner Class :public static class ConfigurationBuilder


Constructor Summary
public  ConfigurationFactory()
    
public  ConfigurationFactory(String configurationFileName)
    

Method Summary
protected  voidenableDigesterSubstitutor(Digester digester)
    
public  StringgetBasePath()
     Returns the Base path from which this Configuration Factory operates. This is never null.
public  ConfigurationgetConfiguration()
     Return the configuration provided by this factory.
public  StringgetConfigurationFileName()
     Returns the configurationFile. The name of the configuration file.
public  URLgetConfigurationURL()
     Returns the URL of the configuration file to be loaded.
public  StringgetDigesterRuleNamespaceURI()
     Returns the digesterRuleNamespaceURI.
public  URLgetDigesterRules()
     Returns the digesterRules.
protected  voidinitDefaultDigesterRules(Digester digester)
     Initializes the parsing rules for the default digester This allows the Configuration Factory to understand the default types: Properties, XML and JNDI.
protected  voidinitDigesterSectionRules(Digester digester, String matchString, boolean additional)
     Sets up digester rules for a specified section of the configuration info file.
public  voidsetBasePath(String basePath)
     Sets the basePath for all file references from this Configuration Factory. Normally a base path need not to be set because it is determined by the location of the configuration file to load.
public  voidsetConfigurationFileName(String configurationFileName)
     Sets the configurationFile.
public  voidsetConfigurationURL(URL url)
     Sets the URL of the configuration to load.
public  voidsetDigesterRuleNamespaceURI(String digesterRuleNamespaceURI)
     Sets the digesterRuleNamespaceURI.
public  voidsetDigesterRules(URL digesterRules)
     Sets the digesterRules.
protected  voidsetupDigesterInstance(Digester digester, String matchString, ObjectCreationFactory factory, String method, boolean additional)
     Sets up digester rules for a configuration to be loaded.
protected  voidsetupUnionRules(Digester digester, String matchString)
     Sets up rules for configurations in the additional section.


Constructor Detail
ConfigurationFactory
public ConfigurationFactory()(Code)
Constructor



ConfigurationFactory
public ConfigurationFactory(String configurationFileName)(Code)
Constructor with ConfigurationFile Name passed
Parameters:
  configurationFileName - The path to the configuration file




Method Detail
enableDigesterSubstitutor
protected void enableDigesterSubstitutor(Digester digester)(Code)
Adds a substitutor to interpolate system properties
Parameters:
  digester - The digester to which we add the substitutor



getBasePath
public String getBasePath()(Code)
Returns the Base path from which this Configuration Factory operates. This is never null. If you set the BasePath to null, then a base path according to the configuration to load is returned. The base Path of this configuration factory.



getConfiguration
public Configuration getConfiguration() throws ConfigurationException(Code)
Return the configuration provided by this factory. It loads the configuration file which is a XML description of the actual configurations to load. It can contain various different types of configuration, e.g. Properties, XML and JNDI. A Configuration object
throws:
  ConfigurationException - A generic exception that we had trouble during theloading of the configuration data.



getConfigurationFileName
public String getConfigurationFileName()(Code)
Returns the configurationFile. The name of the configuration file. Can be null.



getConfigurationURL
public URL getConfigurationURL()(Code)
Returns the URL of the configuration file to be loaded. the URL of the configuration to load



getDigesterRuleNamespaceURI
public String getDigesterRuleNamespaceURI()(Code)
Returns the digesterRuleNamespaceURI. A String with the digesterRuleNamespaceURI.



getDigesterRules
public URL getDigesterRules()(Code)
Returns the digesterRules. URL



initDefaultDigesterRules
protected void initDefaultDigesterRules(Digester digester)(Code)
Initializes the parsing rules for the default digester This allows the Configuration Factory to understand the default types: Properties, XML and JNDI. Two special sections are introduced: <override> and <additional>.
Parameters:
  digester - The digester to configure



initDigesterSectionRules
protected void initDigesterSectionRules(Digester digester, String matchString, boolean additional)(Code)
Sets up digester rules for a specified section of the configuration info file.
Parameters:
  digester - the current digester instance
Parameters:
  matchString - specifies the section
Parameters:
  additional - a flag if rules for the additional section are to beadded



setBasePath
public void setBasePath(String basePath)(Code)
Sets the basePath for all file references from this Configuration Factory. Normally a base path need not to be set because it is determined by the location of the configuration file to load. All relative pathes in this file are resolved relative to this file. Setting a base path makes sense if such relative pathes should be otherwise resolved, e.g. if the configuration file is loaded from the class path and all sub configurations it refers to are stored in a special config directory.
Parameters:
  basePath - The new basePath to set.



setConfigurationFileName
public void setConfigurationFileName(String configurationFileName)(Code)
Sets the configurationFile.
Parameters:
  configurationFileName - The name of the configurationFile to use.



setConfigurationURL
public void setConfigurationURL(URL url)(Code)
Sets the URL of the configuration to load. This configuration can be either specified by a file name or by a URL.
Parameters:
  url - the URL of the configuration to load



setDigesterRuleNamespaceURI
public void setDigesterRuleNamespaceURI(String digesterRuleNamespaceURI)(Code)
Sets the digesterRuleNamespaceURI.
Parameters:
  digesterRuleNamespaceURI - The new digesterRuleNamespaceURI to use



setDigesterRules
public void setDigesterRules(URL digesterRules)(Code)
Sets the digesterRules.
Parameters:
  digesterRules - The digesterRules to set



setupDigesterInstance
protected void setupDigesterInstance(Digester digester, String matchString, ObjectCreationFactory factory, String method, boolean additional)(Code)
Sets up digester rules for a configuration to be loaded.
Parameters:
  digester - the current digester
Parameters:
  matchString - the pattern to match with this rule
Parameters:
  factory - an ObjectCreationFactory instance to use for creating newobjects
Parameters:
  method - the name of a method to be called or null for none
Parameters:
  additional - a flag if rules for the additional section are to beadded



setupUnionRules
protected void setupUnionRules(Digester digester, String matchString)(Code)
Sets up rules for configurations in the additional section.
Parameters:
  digester - the current digester
Parameters:
  matchString - the pattern to match with this rule



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.