public abstract class AbstractProfileConfigMapper<T extends ConfigurationProfile> extends Object implements ConfigurationMapper<T>
Modifier and Type | Field and Description |
---|---|
protected ConfigurationResolver |
configurationResolver |
protected String |
serviceName |
Constructor and Description |
---|
AbstractProfileConfigMapper(String serviceName,
ConfigurationResolver configurationResolver) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
mapProfile(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> profileConfig) |
T |
processConfig(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config)
Reads a single profile from the given configuration
|
T |
readConfig(ConfigurationProvider provider,
String module,
String path,
String encoding,
String profileId)
Reads the configuration from the specified input stream, extracts the specific sub-configuration identified by
configId and maps the configuration to a Java bean. |
protected String serviceName
protected ConfigurationResolver configurationResolver
public AbstractProfileConfigMapper(String serviceName, ConfigurationResolver configurationResolver)
public T readConfig(ConfigurationProvider provider, String module, String path, String encoding, String profileId) throws ConfigurationException
ConfigurationMapper
configId
and maps the configuration to a Java bean.readConfig
in interface ConfigurationMapper<T extends ConfigurationProfile>
provider
- the provider to read the configuration fileencoding
- the charset encoding of the configuration fileprofileId
- the ID of the specific sub-configuration to mapConfigurationException
- if an error occurspublic T processConfig(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config) throws ConfigurationException
ConfigurationMapper
processConfig
in interface ConfigurationMapper<T extends ConfigurationProfile>
config
- the profile configurationConfigurationException
- if an error occursprotected abstract T mapProfile(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> profileConfig) throws ConfigurationException
ConfigurationException
Copyright © 2023 CrafterCMS. All rights reserved.