org.apache.commons.configuration
static class DefaultConfigurationBuilder.FileExtensionConfigurationProvider extends DefaultConfigurationBuilder.FileConfigurationProvider
properties
tag: if the file ends with ".xml" a
XMLPropertiesConfiguration object must be created, otherwise a
PropertiesConfiguration object.
Field Summary | |
---|---|
Class | defaultClass
Stores the class to be created when the file extension does not
match. |
String | defaultClassName
Stores the name of the class to be created when the file extension
does not match. |
String | fileExtension Stores the file extension to be checked against. |
Class | matchingClass
Stores the class to be created when the file extension matches. |
String | matchingClassName
Stores the name of the class to be created when the file extension
matches. |
Constructor Summary | |
---|---|
FileExtensionConfigurationProvider(Class matchingClass, Class defaultClass, String extension)
Creates a new instance of
FileExtensionConfigurationProvider and initializes it.
| |
FileExtensionConfigurationProvider(String matchingClassName, String defaultClassName, String extension)
Creates a new instance of
FileExtensionConfigurationProvider and initializes it
with the names of the classes to be created.
|
Method Summary | |
---|---|
protected Object | createBeanInstance(Class beanClass, BeanDeclaration data)
Creates the configuration object. |
protected Class | fetchDefaultClass()
Returns the default class object, no matter whether it was defined as
a class or as a class name.
|
protected Class | fetchMatchingClass()
Returns the matching class object, no matter whether it was defined
as a class or as a class name.
|
FileExtensionConfigurationProvider
and initializes it.
Parameters: matchingClass the class to be created when the file extension matches defaultClass the class to be created when the file extension does not match extension the file extension to be checked agains
FileExtensionConfigurationProvider
and initializes it
with the names of the classes to be created.
Parameters: matchingClassName the name of the class to be created when the file extension matches defaultClassName the name of the class to be created when the file extension does not match extension the file extension to be checked agains
Since: 1.4
Parameters: beanClass the class data the bean declaration
Returns: the new bean
Throws: Exception if an error occurs
Returns: the default class object
Throws: Exception if an error occurs
Since: 1.4
Returns: the matching class object
Throws: Exception if an error occurs
Since: 1.4