## org.apache.commons.configuration
Class DefaultConfigurationBuilder.FileConfigurationProvider

    java.lang.Object
      org.apache.commons.configuration.beanutils.DefaultBeanFactory
          org.apache.commons.configuration.DefaultConfigurationBuilder.ConfigurationProvider
              org.apache.commons.configuration.DefaultConfigurationBuilder.FileConfigurationProvider

All Implemented Interfaces:
  BeanFactory

Direct Known Subclasses:
  DefaultConfigurationBuilder.FileExtensionConfigurationProvider

Enclosing class:
  DefaultConfigurationBuilder

    public static class DefaultConfigurationBuilder.FileConfigurationProvider

extends DefaultConfigurationBuilder.ConfigurationProvider

A specialized provider implementation that deals with file based configurations. Ensures that the base path is correctly set and that the load() method gets called.

Field Summary

Fields inherited from class org.apache.commons.configuration.beanutils.DefaultBeanFactory
`INSTANCE`

Constructor Summary
`DefaultConfigurationBuilder.FileConfigurationProvider()` Creates a new instance of `FileConfigurationProvider`.
`DefaultConfigurationBuilder.FileConfigurationProvider(Class configClass)` Creates a new instance of `FileConfigurationProvider` and sets the configuration class.

Method Summary
`AbstractConfiguration` `getConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl)` Creates the configuration.
`protected void` `initBeanInstance(Object bean, BeanDeclaration data)` Initializes the bean instance.

Methods inherited from class org.apache.commons.configuration.DefaultConfigurationBuilder.ConfigurationProvider
`getConfigurationClass, setConfigurationClass`

Methods inherited from class org.apache.commons.configuration.beanutils.DefaultBeanFactory
`createBean, createBeanInstance, getDefaultBeanClass`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultConfigurationBuilder.FileConfigurationProvider

    public DefaultConfigurationBuilder.FileConfigurationProvider()

  Creates a new instance of `FileConfigurationProvider`.

### DefaultConfigurationBuilder.FileConfigurationProvider

    public DefaultConfigurationBuilder.FileConfigurationProvider(Class configClass)

  Creates a new instance of `FileConfigurationProvider` and sets the configuration class.

  Parameters:
    `configClass` - the class for the configurations to be created

Method Detail

### getConfiguration

    public AbstractConfiguration getConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl)
                                           throws Exception

  Creates the configuration. After that `load()` will be called. If this configuration is marked as optional, exceptions will be ignored.

  Overrides:
    `getConfiguration` in class `DefaultConfigurationBuilder.ConfigurationProvider`
  Parameters:
    `decl` - the declaration
  Returns:
    the new configuration
  Throws:
    `Exception` - if an error occurs

### initBeanInstance

    protected void initBeanInstance(Object bean,
                                    BeanDeclaration data)
                             throws Exception

  Initializes the bean instance. Ensures that the file configuration's base path will be initialized with the base path of the factory so that relative path names can be correctly resolved.

  Overrides:
    `initBeanInstance` in class `DefaultBeanFactory`
  Parameters:
    `bean` - the bean to be initialized
    `data` - the declaration
  Throws:
    `Exception` - if an error occurs

Copyright © 2001-2006 The Apache Software Foundation. All Rights Reserved.