public static class DefaultConfigurationBuilder.FileConfigurationProvider extends DefaultConfigurationBuilder.ConfigurationProvider
INSTANCE
Constructor and Description |
---|
DefaultConfigurationBuilder.FileConfigurationProvider()
Creates a new instance of
FileConfigurationProvider . |
DefaultConfigurationBuilder.FileConfigurationProvider(Class configClass)
Creates a new instance of
FileConfigurationProvider
and sets the configuration class. |
DefaultConfigurationBuilder.FileConfigurationProvider(String configClassName)
Creates a new instance of
FileConfigurationProvider
and sets the configuration class name. |
Modifier and Type | Method and Description |
---|---|
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.
|
fetchConfigurationClass, getConfigurationClass, getConfigurationClassName, loadClass, setConfigurationClass, setConfigurationClassName
createBean, createBeanInstance, getDefaultBeanClass
public DefaultConfigurationBuilder.FileConfigurationProvider()
FileConfigurationProvider
.public DefaultConfigurationBuilder.FileConfigurationProvider(Class configClass)
FileConfigurationProvider
and sets the configuration class.configClass
- the class for the configurations to be createdpublic DefaultConfigurationBuilder.FileConfigurationProvider(String configClassName)
FileConfigurationProvider
and sets the configuration class name.configClassName
- the name of the configuration to be createdpublic AbstractConfiguration getConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl) throws Exception
load()
will be
called. If this configuration is marked as optional, exceptions will
be ignored.getConfiguration
in class DefaultConfigurationBuilder.ConfigurationProvider
decl
- the declarationException
- if an error occurspublic AbstractConfiguration getEmptyConfiguration(DefaultConfigurationBuilder.ConfigurationDeclaration decl) throws Exception
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.getEmptyConfiguration
in class DefaultConfigurationBuilder.ConfigurationProvider
decl
- the bean declaration with initialization parameters for
the configurationException
- if an error occursprotected void initBeanInstance(Object bean, BeanDeclaration data) throws Exception
initBeanInstance
in class DefaultBeanFactory
bean
- the bean to be initializeddata
- the declarationException
- if an error occursCopyright © 2018 JBoss by Red Hat. All rights reserved.