DefaultConfigurationBuilder instead; this class
provides the same features as ConfigurationFactory plus some more; it can
also process the same configuration definition files.@Deprecated public class ConfigurationFactory extends java.lang.Object
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.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ConfigurationFactory.AdditionalConfigurationData |
Deprecated.
A simple data class that holds all information about a configuration
from the
<additional> section. |
static class |
ConfigurationFactory.ConfigurationBuilder |
Deprecated.
An internally used helper class for constructing the composite
configuration object.
|
class |
ConfigurationFactory.DigesterConfigurationFactory |
Deprecated.
A base class for digester factory classes.
|
class |
ConfigurationFactory.FileConfigurationFactory |
Deprecated.
A tiny inner class that allows the Configuration Factory to
let the digester construct FileConfiguration objects
that already have the correct base Path set.
|
class |
ConfigurationFactory.PropertiesConfigurationFactory |
Deprecated.
A factory that returns an XMLPropertiesConfiguration for .xml files
and a PropertiesConfiguration for the others.
|
class |
ConfigurationFactory.PropertyListConfigurationFactory |
Deprecated.
A factory that returns an XMLPropertyListConfiguration for .xml files
and a PropertyListConfiguration for the others.
|
| Constructor | Description |
|---|---|
ConfigurationFactory() |
Deprecated.
Constructor
|
ConfigurationFactory(java.lang.String configurationFileName) |
Deprecated.
Constructor with ConfigurationFile Name passed
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
enableDigesterSubstitutor(org.apache.commons.digester.Digester digester) |
Deprecated.
Adds a substitutor to interpolate system properties
|
java.lang.String |
getBasePath() |
Deprecated.
Returns the Base path from which this Configuration Factory operates.
|
Configuration |
getConfiguration() |
Deprecated.
Return the configuration provided by this factory.
|
java.lang.String |
getConfigurationFileName() |
Deprecated.
Returns the configurationFile.
|
java.net.URL |
getConfigurationURL() |
Deprecated.
Returns the URL of the configuration file to be loaded.
|
java.lang.String |
getDigesterRuleNamespaceURI() |
Deprecated.
Returns the digesterRuleNamespaceURI.
|
java.net.URL |
getDigesterRules() |
Deprecated.
Returns the digesterRules.
|
protected void |
initDefaultDigesterRules(org.apache.commons.digester.Digester digester) |
Deprecated.
Initializes the parsing rules for the default digester
This allows the Configuration Factory to understand the default types:
Properties, XML and JNDI.
|
protected void |
initDigesterSectionRules(org.apache.commons.digester.Digester digester,
java.lang.String matchString,
boolean additional) |
Deprecated.
Sets up digester rules for a specified section of the configuration
info file.
|
void |
setBasePath(java.lang.String basePath) |
Deprecated.
Sets the basePath for all file references from this Configuration Factory.
|
void |
setConfigurationFileName(java.lang.String configurationFileName) |
Deprecated.
Sets the configurationFile.
|
void |
setConfigurationURL(java.net.URL url) |
Deprecated.
Sets the URL of the configuration to load.
|
void |
setDigesterRuleNamespaceURI(java.lang.String digesterRuleNamespaceURI) |
Deprecated.
Sets the digesterRuleNamespaceURI.
|
void |
setDigesterRules(java.net.URL digesterRules) |
Deprecated.
Sets the digesterRules.
|
protected void |
setupDigesterInstance(org.apache.commons.digester.Digester digester,
java.lang.String matchString,
org.apache.commons.digester.ObjectCreationFactory factory,
java.lang.String method,
boolean additional) |
Deprecated.
Sets up digester rules for a configuration to be loaded.
|
protected void |
setupUnionRules(org.apache.commons.digester.Digester digester,
java.lang.String matchString) |
Deprecated.
Sets up rules for configurations in the additional section.
|
public ConfigurationFactory()
public ConfigurationFactory(java.lang.String configurationFileName)
configurationFileName - The path to the configuration filepublic Configuration getConfiguration() throws ConfigurationException
ConfigurationException - A generic exception that we had trouble during the
loading of the configuration data.public java.lang.String getConfigurationFileName()
public void setConfigurationFileName(java.lang.String configurationFileName)
configurationFileName - The name of the configurationFile to use.public java.net.URL getConfigurationURL()
public void setConfigurationURL(java.net.URL url)
url - the URL of the configuration to loadpublic java.net.URL getDigesterRules()
public void setDigesterRules(java.net.URL digesterRules)
digesterRules - The digesterRules to setprotected void enableDigesterSubstitutor(org.apache.commons.digester.Digester digester)
digester - The digester to which we add the substitutorprotected void initDefaultDigesterRules(org.apache.commons.digester.Digester digester)
<override> and <additional>.digester - The digester to configureprotected void initDigesterSectionRules(org.apache.commons.digester.Digester digester, java.lang.String matchString, boolean additional)
digester - the current digester instancematchString - specifies the sectionadditional - a flag if rules for the additional section are to be
addedprotected void setupDigesterInstance(org.apache.commons.digester.Digester digester, java.lang.String matchString, org.apache.commons.digester.ObjectCreationFactory factory, java.lang.String method, boolean additional)
digester - the current digestermatchString - the pattern to match with this rulefactory - an ObjectCreationFactory instance to use for creating new
objectsmethod - the name of a method to be called or null for noneadditional - a flag if rules for the additional section are to be
addedprotected void setupUnionRules(org.apache.commons.digester.Digester digester, java.lang.String matchString)
digester - the current digestermatchString - the pattern to match with this rulepublic java.lang.String getDigesterRuleNamespaceURI()
public void setDigesterRuleNamespaceURI(java.lang.String digesterRuleNamespaceURI)
digesterRuleNamespaceURI - The new digesterRuleNamespaceURI to usepublic java.lang.String getBasePath()
public void setBasePath(java.lang.String basePath)
basePath - The new basePath to set.