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 interfaceConfigurationContextImpl.ConfigurationSourceFunction interface to obtain theInputStreamfor 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 ConfigurationItemcreateConfigurationItem(java.lang.String location, byte[] rawConfiguration, java.lang.String configuration, java.nio.charset.Charset charset)Creates theConfigurationItem.ConfigurationItemgetConfigurationItem(java.lang.String location, PropertyList properties)Obtains theConfigurationItemat the location.protected ConfigurationContextImpl.ConfigurationSourcegetConfigurationSource()Obtains theConfigurationContextImpl.ConfigurationSource.ConfigurationItemgetOptionalConfigurationItem(java.lang.String location, PropertyList properties)Obtains the optionalConfigurationItemat 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 withPropertyreplacement.charset- OutputCharset.- Returns:
ConfigurationItem.
-
getConfigurationItem
public ConfigurationItem getConfigurationItem(java.lang.String location, PropertyList properties)
Description copied from interface:ConfigurationContextObtains the
ConfigurationItemat the location.Tags within the configuration are replaced by the
PropertyListfollowing naming convention${PropertyName}.- Specified by:
getConfigurationItemin interfaceConfigurationContext- Parameters:
location- Location of theConfigurationItemto obtain.properties- OverridePropertyListfor tag replacement. May benull.- Returns:
ConfigurationItem.
-
getOptionalConfigurationItem
public ConfigurationItem getOptionalConfigurationItem(java.lang.String location, PropertyList properties)
Description copied from interface:ConfigurationContextObtains the optional
ConfigurationItemat the location. May returnnullif notConfigurationItemat the location.Also, undertakes tag replacement from the
PropertyList.- Specified by:
getOptionalConfigurationItemin interfaceConfigurationContext- Parameters:
location- Location of theConfigurationItemto obtain.properties- OverridePropertyListfor tag replacement. May benull.- Returns:
ConfigurationItemornullif no configuration at location.
-
-