Class ConfigurationContextImpl
- java.lang.Object
-
- net.officefloor.configuration.impl.ConfigurationContextImpl
-
- All Implemented Interfaces:
ConfigurationContext
- Direct Known Subclasses:
AbstractWritableConfigurationContext
,ClassLoaderConfigurationContext
,XmlFileConfigurationContext
public class ConfigurationContextImpl extends java.lang.Object implements ConfigurationContext
AbstractConfigurationContext
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ConfigurationContextImpl.ConfigurationSource
Function interface to obtain theInputStream
for theConfigurationItem
.
-
Field Summary
-
Fields inherited from interface net.officefloor.configuration.ConfigurationContext
DEFAULT_TAG_PREFIX, DEFAULT_TAG_SUFFIX, PROPERTY_CONFIGURATION_INPUT_CHARSET, PROPERTY_CONFIGURATION_INPUT_TAG_PREFIX, PROPERTY_CONFIGURATION_INPUT_TAG_SUFFIX, PROPERTY_CONFIGURATION_OUTPUT_CHARSET
-
-
Constructor Summary
Constructors Constructor Description ConfigurationContextImpl(ConfigurationContextImpl.ConfigurationSource configurationSource, SourceProperties properties)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConfigurationItem
createConfigurationItem(java.lang.String location, byte[] rawConfiguration, java.lang.String configuration, java.nio.charset.Charset charset)
Creates theConfigurationItem
.ConfigurationItem
getConfigurationItem(java.lang.String location, PropertyList properties)
Obtains theConfigurationItem
at the location.protected ConfigurationContextImpl.ConfigurationSource
getConfigurationSource()
Obtains theConfigurationContextImpl.ConfigurationSource
.ConfigurationItem
getOptionalConfigurationItem(java.lang.String location, PropertyList properties)
Obtains the optionalConfigurationItem
at the location.
-
-
-
Constructor Detail
-
ConfigurationContextImpl
public ConfigurationContextImpl(ConfigurationContextImpl.ConfigurationSource configurationSource, SourceProperties properties)
Instantiate.- Parameters:
configurationSource
-ConfigurationContextImpl.ConfigurationSource
.properties
-SourceProperties
.
-
-
Method Detail
-
getConfigurationSource
protected ConfigurationContextImpl.ConfigurationSource getConfigurationSource()
Obtains theConfigurationContextImpl.ConfigurationSource
.
-
createConfigurationItem
protected ConfigurationItem createConfigurationItem(java.lang.String location, byte[] rawConfiguration, java.lang.String configuration, java.nio.charset.Charset charset)
Creates the
ConfigurationItem
.Provided to enable overriding the creation of the
ConfigurationItem
.- Parameters:
location
- Location of theConfigurationItem
.rawConfiguration
- Raw configuration read fromConfigurationContextImpl.ConfigurationSource
.configuration
- Configuration withProperty
replacement.charset
- OutputCharset
.- Returns:
ConfigurationItem
.
-
getConfigurationItem
public ConfigurationItem getConfigurationItem(java.lang.String location, PropertyList properties)
Description copied from interface:ConfigurationContext
Obtains the
ConfigurationItem
at the location.Tags within the configuration are replaced by the
PropertyList
following naming convention${PropertyName}
.- Specified by:
getConfigurationItem
in interfaceConfigurationContext
- Parameters:
location
- Location of theConfigurationItem
to obtain.properties
- OverridePropertyList
for tag replacement. May benull
.- Returns:
ConfigurationItem
.
-
getOptionalConfigurationItem
public ConfigurationItem getOptionalConfigurationItem(java.lang.String location, PropertyList properties)
Description copied from interface:ConfigurationContext
Obtains the optional
ConfigurationItem
at the location. May returnnull
if notConfigurationItem
at the location.Also, undertakes tag replacement from the
PropertyList
.- Specified by:
getOptionalConfigurationItem
in interfaceConfigurationContext
- Parameters:
location
- Location of theConfigurationItem
to obtain.properties
- OverridePropertyList
for tag replacement. May benull
.- Returns:
ConfigurationItem
ornull
if no configuration at location.
-
-