org.apache.commons.configuration
public static class DefaultConfigurationBuilder.FileConfigurationProvider extends DefaultConfigurationBuilder.ConfigurationProvider
Constructor Summary | |
---|---|
FileConfigurationProvider()
Creates a new instance of FileConfigurationProvider . | |
FileConfigurationProvider(Class configClass)
Creates a new instance of FileConfigurationProvider
and sets the configuration class.
| |
FileConfigurationProvider(String configClassName)
Creates a new instance of FileConfigurationProvider
and sets the configuration class name.
|
Method Summary | |
---|---|
AbstractConfiguration | getConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl)
Creates the configuration. |
AbstractConfiguration | getEmptyConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl)
Returns an uninitialized file configuration. |
protected void | initBeanInstance(Object bean, BeanDeclaration data)
Initializes the bean instance. |
FileConfigurationProvider
.FileConfigurationProvider
and sets the configuration class.
Parameters: configClass the class for the configurations to be created
FileConfigurationProvider
and sets the configuration class name.
Parameters: configClassName the name of the configuration to be created
Since: 1.4
load()
will be
called. If this configuration is marked as optional, exceptions will
be ignored.
Parameters: decl the declaration
Returns: the new configuration
Throws: Exception if an error occurs
getConfiguration()
method caused an error and the
forceCreate
attribute is set. It will create the
configuration of the represented type, but the load()
method won't be called. This way non-existing configuration files can
be handled gracefully: If loading a the file fails, an empty
configuration will be created that is already configured with the
correct file name.
Parameters: decl the bean declaration with initialization parameters for the configuration
Returns: the new configuration object
Throws: Exception if an error occurs
Since: 1.4
Parameters: bean the bean to be initialized data the declaration
Throws: Exception if an error occurs