org.apache.commons.configuration
Class DefaultConfigurationBuilder.FileExtensionConfigurationProvider
java.lang.Object
org.apache.commons.configuration.beanutils.DefaultBeanFactory
org.apache.commons.configuration.DefaultConfigurationBuilder.ConfigurationProvider
org.apache.commons.configuration.DefaultConfigurationBuilder.FileConfigurationProvider
org.apache.commons.configuration.DefaultConfigurationBuilder.FileExtensionConfigurationProvider
- All Implemented Interfaces:
- BeanFactory
- Enclosing class:
- DefaultConfigurationBuilder
- static class DefaultConfigurationBuilder.FileExtensionConfigurationProvider
- extends DefaultConfigurationBuilder.FileConfigurationProvider
A specialized configuration provider for file based configurations that
can handle configuration sources whose concrete type depends on the
extension of the file to be loaded. One example is the
properties
tag: if the file ends with ".xml" a
XMLPropertiesConfiguration object must be created, otherwise a
PropertiesConfiguration object.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultConfigurationBuilder.FileExtensionConfigurationProvider
public DefaultConfigurationBuilder.FileExtensionConfigurationProvider(Class matchingClass,
Class defaultClass,
String extension)
- Creates a new instance of
FileExtensionConfigurationProvider
and initializes it.
- Parameters:
matchingClass
- the class to be created when the file extension
matchesdefaultClass
- the class to be created when the file extension
does not matchextension
- the file extension to be checked agains
createBeanInstance
protected Object createBeanInstance(Class beanClass,
BeanDeclaration data)
throws Exception
- Creates the configuration object. The class is determined by the file
name's extension.
- Overrides:
createBeanInstance
in class DefaultBeanFactory
- Parameters:
beanClass
- the classdata
- the bean declaration
- Returns:
- the new bean
- Throws:
Exception
- if an error occurs
Copyright © 2001-2006 The Apache Software Foundation. All Rights Reserved.