Package org.craftercms.commons.config
Class ConfigurationResolverImpl
java.lang.Object
org.craftercms.commons.config.ConfigurationResolverImpl
- All Implemented Interfaces:
ConfigurationResolver
Default implementation of
ConfigurationResolver
- Since:
- 3.1.6
- Author:
- joseross
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The path pattern for the default environmentprotected EncryptionAwareConfigurationReader
static final String
protected String
The active environmentprotected String
The path pattern for a specific environmentstatic final String
static final String
-
Constructor Summary
ConstructorDescriptionConfigurationResolverImpl
(String environment, String basePath, String envPath, EncryptionAwareConfigurationReader configurationReader) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.configuration2.HierarchicalConfiguration<?>
getXmlConfiguration
(String module, String path, ConfigurationProvider provider) Get the content of a given configuration file
-
Field Details
-
DEFAULT_ENVIRONMENT
- See Also:
-
PLACEHOLDER_MODULE
- See Also:
-
PLACEHOLDER_ENVIRONMENT
- See Also:
-
environment
The active environment -
basePath
The path pattern for the default environment -
envPath
The path pattern for a specific environment -
configurationReader
-
-
Constructor Details
-
ConfigurationResolverImpl
@ConstructorProperties({"environment","basePath","envPath","configurationReader"}) public ConfigurationResolverImpl(String environment, String basePath, String envPath, EncryptionAwareConfigurationReader configurationReader)
-
-
Method Details
-
getXmlConfiguration
public org.apache.commons.configuration2.HierarchicalConfiguration<?> getXmlConfiguration(String module, String path, ConfigurationProvider provider) throws ConfigurationException Description copied from interface:ConfigurationResolver
Get the content of a given configuration file- Specified by:
getXmlConfiguration
in interfaceConfigurationResolver
- Parameters:
module
- the name of the modulepath
- the path of the fileprovider
- the provider to read the file- Returns:
- the configuration instance
- Throws:
ConfigurationException
- if there is any error reading the configuration
-