Class AbstractWritableConfigurationContext
- java.lang.Object
-
- net.officefloor.configuration.impl.ConfigurationContextImpl
-
- net.officefloor.configuration.impl.AbstractWritableConfigurationContext
-
- All Implemented Interfaces:
ConfigurationContext
,WritableConfigurationContext
- Direct Known Subclasses:
FileSystemConfigurationContext
,MemoryConfigurationContext
,ProjectConfigurationContext
public class AbstractWritableConfigurationContext extends ConfigurationContextImpl implements WritableConfigurationContext
AbstractWritableConfigurationContext
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractWritableConfigurationContext.ConfigurationRemover
Function interface to remove theConfigurationItem
.static interface
AbstractWritableConfigurationContext.ConfigurationWriter
Function interface to write theInputStream
for theConfigurationItem
.-
Nested classes/interfaces inherited from class net.officefloor.configuration.impl.ConfigurationContextImpl
ConfigurationContextImpl.ConfigurationSource
-
-
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 AbstractWritableConfigurationContext()
Default construction.AbstractWritableConfigurationContext(ConfigurationContextImpl.ConfigurationSource configurationSource, AbstractWritableConfigurationContext.ConfigurationWriter configurationWriter, AbstractWritableConfigurationContext.ConfigurationRemover configurationRemover, PropertyList 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
.WritableConfigurationItem
createConfigurationItem(java.lang.String location, java.io.InputStream configuration)
Creates a newWritableConfigurationItem
at the relative location.void
deleteConfigurationItem(java.lang.String location)
Deletes theWritableConfigurationItem
at the relative location.protected ConfigurationContextImpl.ConfigurationSource
getConfigurationSource()
Obtains theConfigurationContextImpl.ConfigurationSource
.WritableConfigurationItem
getWritableConfigurationItem(java.lang.String location)
Obtains theWritableConfigurationItem
at the location.protected void
init(ConfigurationContextImpl.ConfigurationSource configurationSource, AbstractWritableConfigurationContext.ConfigurationWriter configurationWriter, AbstractWritableConfigurationContext.ConfigurationRemover configurationRemover)
Instantiate.-
Methods inherited from class net.officefloor.configuration.impl.ConfigurationContextImpl
getConfigurationItem, getOptionalConfigurationItem
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.configuration.ConfigurationContext
getConfigurationItem, getOptionalConfigurationItem
-
-
-
-
Constructor Detail
-
AbstractWritableConfigurationContext
public AbstractWritableConfigurationContext(ConfigurationContextImpl.ConfigurationSource configurationSource, AbstractWritableConfigurationContext.ConfigurationWriter configurationWriter, AbstractWritableConfigurationContext.ConfigurationRemover configurationRemover, PropertyList properties)
Instantiate.- Parameters:
configurationSource
-ConfigurationContextImpl.ConfigurationSource
.configurationWriter
-AbstractWritableConfigurationContext.ConfigurationWriter
.configurationRemover
-AbstractWritableConfigurationContext.ConfigurationRemover
.properties
-PropertyList
.
-
AbstractWritableConfigurationContext
public AbstractWritableConfigurationContext()
Default construction. Must invokeinit()
method to use.
-
-
Method Detail
-
init
protected void init(ConfigurationContextImpl.ConfigurationSource configurationSource, AbstractWritableConfigurationContext.ConfigurationWriter configurationWriter, AbstractWritableConfigurationContext.ConfigurationRemover configurationRemover)
Instantiate.- Parameters:
configurationSource
-ConfigurationContextImpl.ConfigurationSource
.configurationWriter
-AbstractWritableConfigurationContext.ConfigurationWriter
.configurationRemover
-AbstractWritableConfigurationContext.ConfigurationRemover
.
-
getConfigurationSource
protected ConfigurationContextImpl.ConfigurationSource getConfigurationSource()
Description copied from class:ConfigurationContextImpl
Obtains theConfigurationContextImpl.ConfigurationSource
.- Overrides:
getConfigurationSource
in classConfigurationContextImpl
- Returns:
ConfigurationContextImpl.ConfigurationSource
.
-
createConfigurationItem
protected ConfigurationItem createConfigurationItem(java.lang.String location, byte[] rawConfiguration, java.lang.String configuration, java.nio.charset.Charset charset)
Description copied from class:ConfigurationContextImpl
Creates the
ConfigurationItem
.Provided to enable overriding the creation of the
ConfigurationItem
.- Overrides:
createConfigurationItem
in classConfigurationContextImpl
- Parameters:
location
- Location of theConfigurationItem
.rawConfiguration
- Raw configuration read fromConfigurationContextImpl.ConfigurationSource
.configuration
- Configuration withProperty
replacement.charset
- OutputCharset
.- Returns:
ConfigurationItem
.
-
getWritableConfigurationItem
public WritableConfigurationItem getWritableConfigurationItem(java.lang.String location) throws java.io.IOException
Description copied from interface:WritableConfigurationContext
Obtains theWritableConfigurationItem
at the location.- Specified by:
getWritableConfigurationItem
in interfaceWritableConfigurationContext
- Parameters:
location
- Location of theWritableConfigurationItem
to obtain.- Returns:
WritableConfigurationItem
.- Throws:
java.io.IOException
- If can not obtain aWritableConfigurationItem
at the location.
-
createConfigurationItem
public WritableConfigurationItem createConfigurationItem(java.lang.String location, java.io.InputStream configuration) throws java.io.IOException
Description copied from interface:WritableConfigurationContext
Creates a newWritableConfigurationItem
at the relative location.- Specified by:
createConfigurationItem
in interfaceWritableConfigurationContext
- Parameters:
location
- Location of theWritableConfigurationItem
to create.configuration
- Configuration for theWritableConfigurationItem
.- Returns:
- The created
WritableConfigurationItem
. - Throws:
java.io.IOException
- If fails to create theWritableConfigurationItem
.
-
deleteConfigurationItem
public void deleteConfigurationItem(java.lang.String location) throws java.io.IOException
Description copied from interface:WritableConfigurationContext
Deletes theWritableConfigurationItem
at the relative location.- Specified by:
deleteConfigurationItem
in interfaceWritableConfigurationContext
- Parameters:
location
- Location of theWritableConfigurationItem
to delete.- Throws:
java.io.IOException
- If can not delete theWritableConfigurationItem
at the relative location.
-
-