Package org.craftercms.commons.config
Interface ConfigurationMapper<T>
- All Known Implementing Classes:
AbstractAwsProfileMapper
,AbstractProfileConfigMapper
,BoxProfileMapper
,S3ProfileMapper
,WebDavProfileMapper
public interface ConfigurationMapper<T>
Interface for classes that map configuration data to Java bean classes.
- Author:
- avasquez
-
Method Summary
Modifier and TypeMethodDescriptionprocessConfig
(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config) Reads a single profile from the given configurationreadConfig
(ConfigurationProvider provider, String module, String path, String encoding, String configId) Reads the configuration from the specified input stream, extracts the specific sub-configuration identified byconfigId
and maps the configuration to a Java bean.
-
Method Details
-
readConfig
T readConfig(ConfigurationProvider provider, String module, String path, String encoding, String configId) throws ConfigurationException, ConfigurationProfileNotFoundException Reads the configuration from the specified input stream, extracts the specific sub-configuration identified byconfigId
and maps the configuration to a Java bean.- Parameters:
provider
- the provider to read the configuration fileencoding
- the charset encoding of the configuration fileconfigId
- the ID of the specific sub-configuration to map- Returns:
- the configuration object
- Throws:
ConfigurationException
- if an error occursConfigurationProfileNotFoundException
- if profile is not found
-
processConfig
T processConfig(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config) throws ConfigurationException Reads a single profile from the given configuration- Parameters:
config
- the profile configuration- Returns:
- the configuration object
- Throws:
ConfigurationException
- if an error occurs
-