|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.configuration.beanutils.DefaultBeanFactory
org.apache.commons.configuration.DefaultConfigurationBuilder.ConfigurationProvider
public static class DefaultConfigurationBuilder.ConfigurationProvider
A base class for creating and initializing configuration sources.
Concrete sub classes of this base class are responsible for creating
specific Configuration objects for the tags in the
configuration definition file. The configuration factory will parse the
definition file and try to find a matching
ConfigurationProvider for each encountered tag. This
provider is then asked to create a corresponding
Configuration object. It is up to a concrete
implementation how this object is created and initialized.
Note that at the moment only configuration classes derived from
are supported.
AbstractConfiguration
| Field Summary | |
|---|---|
private java.lang.Class |
configurationClass
Stores the class of the configuration to be created. |
private java.lang.String |
configurationClassName
Stores the name of the configuration class to be created. |
| Fields inherited from class org.apache.commons.configuration.beanutils.DefaultBeanFactory |
|---|
INSTANCE |
| Constructor Summary | |
|---|---|
DefaultConfigurationBuilder.ConfigurationProvider()
Creates a new uninitialized instance of ConfigurationProvider. |
|
DefaultConfigurationBuilder.ConfigurationProvider(java.lang.Class configClass)
Creates a new instance of ConfigurationProvider and
sets the class of the configuration created by this provider. |
|
DefaultConfigurationBuilder.ConfigurationProvider(java.lang.String configClassName)
Creates a new instance of ConfigurationProvider and
sets the name of the class of the configuration created by this
provider. |
|
| Method Summary | |
|---|---|
protected java.lang.Class |
fetchConfigurationClass()
Returns the configuration class supported by this provider. |
AbstractConfiguration |
getConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl)
Returns the configuration. |
java.lang.Class |
getConfigurationClass()
Returns the class of the configuration returned by this provider. |
java.lang.String |
getConfigurationClassName()
Returns the name of the configuration class returned by this provider. |
AbstractConfiguration |
getEmptyConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl)
Returns an uninitialized configuration of the represented type. |
protected java.lang.Class |
loadClass(java.lang.String className)
Loads the class with the specified name dynamically. |
void |
setConfigurationClass(java.lang.Class configurationClass)
Sets the class of the configuration returned by this provider. |
void |
setConfigurationClassName(java.lang.String configurationClassName)
Sets the name of the configuration class returned by this provider. |
| Methods inherited from class org.apache.commons.configuration.beanutils.DefaultBeanFactory |
|---|
createBean, createBeanInstance, getDefaultBeanClass, initBeanInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.Class configurationClass
private java.lang.String configurationClassName
| Constructor Detail |
|---|
public DefaultConfigurationBuilder.ConfigurationProvider()
ConfigurationProvider.
public DefaultConfigurationBuilder.ConfigurationProvider(java.lang.Class configClass)
ConfigurationProvider and
sets the class of the configuration created by this provider.
configClass - the configuration classpublic DefaultConfigurationBuilder.ConfigurationProvider(java.lang.String configClassName)
ConfigurationProvider and
sets the name of the class of the configuration created by this
provider.
configClassName - the name of the configuration class| Method Detail |
|---|
public java.lang.Class getConfigurationClass()
public void setConfigurationClass(java.lang.Class configurationClass)
configurationClass - the configuration classpublic java.lang.String getConfigurationClassName()
public void setConfigurationClassName(java.lang.String configurationClassName)
configurationClassName - the name of the configuration class
public AbstractConfiguration getConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl)
throws java.lang.Exception
createBean() method to create a new instance of the
configuration class.
decl - the bean declaration with initialization parameters for
the configuration
java.lang.Exception - if an error occurs
public AbstractConfiguration getEmptyConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl)
throws java.lang.Exception
getConfiguration() method caused an error and the
forceCreate attribute is set. A concrete sub class can
here try to create an uninitialized, empty configuration, which may
be possible if the error was created during initialization. This base
implementation just returns null.
decl - the bean declaration with initialization parameters for
the configuration
java.lang.Exception - if an error occurs
protected java.lang.Class fetchConfigurationClass()
throws java.lang.Exception
java.lang.Exception
protected java.lang.Class loadClass(java.lang.String className)
throws java.lang.ClassNotFoundException
className - the name of the class to be loaded
java.lang.ClassNotFoundException - if class loading fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||