Package org.refcodes.configuration
Class AbstractResourcePropertiesDecorator<T extends ResourceProperties>
- java.lang.Object
-
- org.refcodes.configuration.AbstractPropertiesDecorator<T>
-
- org.refcodes.configuration.AbstractResourcePropertiesDecorator<T>
-
- Type Parameters:
T
- The actual (sub-) type of theProperties
to be decorated.
- All Implemented Interfaces:
Properties
,ResourceProperties
,org.refcodes.mixin.DelimiterAccessor
,org.refcodes.mixin.Dumpable
,org.refcodes.mixin.TypeAccessor<java.lang.String>
,org.refcodes.structure.CanonicalMap
,org.refcodes.structure.Containable
,org.refcodes.structure.Dictionary<java.lang.String,java.lang.String>
,org.refcodes.structure.Keys<java.lang.String,java.lang.String>
,org.refcodes.structure.PathMap<java.lang.String>
,org.refcodes.structure.PropertiesAccessorMixin
- Direct Known Subclasses:
PolyglotProperties
,ScheduledResourcePropertiesDecorator
public abstract class AbstractResourcePropertiesDecorator<T extends ResourceProperties> extends AbstractPropertiesDecorator<T> implements ResourceProperties
Decorates the providedResourceProperties
and delegates method calls to themResourceProperties
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.structure.CanonicalMap
org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
-
Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary
org.refcodes.structure.Dictionary.MutableDictionary<K extends java.lang.Object,V extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.Keys
org.refcodes.structure.Keys.MutableKeys<K extends java.lang.Object,V extends java.lang.Object>, org.refcodes.structure.Keys.MutableValues<K extends java.lang.Object,V extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.PathMap
org.refcodes.structure.PathMap.MutablePathMap<T extends java.lang.Object>, org.refcodes.structure.PathMap.PathMapBuilder<T extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.refcodes.configuration.Properties
Properties.MutableProperties, Properties.PropertiesBuilder
-
Nested classes/interfaces inherited from interface org.refcodes.structure.PropertiesAccessorMixin
org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<T extends java.lang.Object>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
-
Nested classes/interfaces inherited from interface org.refcodes.configuration.ResourceProperties
ResourceProperties.MutableResoureProperties, ResourceProperties.ResourcePropertiesBuilder
-
-
Field Summary
-
Fields inherited from interface org.refcodes.configuration.Properties
DEFAULT_COMMENT
-
Fields inherited from interface org.refcodes.configuration.ResourceProperties
VALUE_ATTRIBUTES
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractResourcePropertiesDecorator()
Make sure to set the getProperties() member variable!AbstractResourcePropertiesDecorator(T aProperties)
Decorates the providedResourceProperties
with additional behavior or functionality.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Properties
reload()
Reloads theResourceProperties
from the resource to which theResourceProperties
are attached to (such as aFile
as ofResourceProperties.MutableResoureProperties.loadFrom(File)
orResourceProperties.MutableResoureProperties.saveTo(File)
).Properties
reload(ReloadMode aReloadMode)
Reloads theResourceProperties
from the resource to which theResourceProperties
are attached to (such as aFile
as ofResourceProperties.MutableResoureProperties.loadFrom(File)
orResourceProperties.MutableResoureProperties.saveTo(File)
).-
Methods inherited from class org.refcodes.configuration.AbstractPropertiesDecorator
childrenOf, containsKey, get, getDelimiter, getProperties, isEmpty, keySet, retrieveFrom, retrieveTo, setProperties, size, toDataStructure, values
-
Methods inherited from interface org.refcodes.structure.CanonicalMap
toInstance, toInstance, toType, toType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.structure.PathMap
directories, directories, entries, entries, fromExternalKey, get, get, getArray, getArray, getIndexes, getIndexes, getRootPath, hasIndexed, hasIndexed, hasParentPath, isArray, isArray, isDirectory, isEntry, isIndexed, isIndexed, isPath, isRecord, isRootPath, keySet, paths, paths, records, records, toDataStructure, toDataStructure, toExternalKey, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath, toPath
-
Methods inherited from interface org.refcodes.configuration.Properties
childrenOf, containsValue, getDelimiter, getIndexed, getIndexed, getType, retrieve, retrieveFrom, retrieveTo, toMap, toProperties, toPropertyPath
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin
containsKey, get, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
-
-
-
-
Constructor Detail
-
AbstractResourcePropertiesDecorator
protected AbstractResourcePropertiesDecorator()
Make sure to set the getProperties() member variable!
-
AbstractResourcePropertiesDecorator
public AbstractResourcePropertiesDecorator(T aProperties)
Decorates the providedResourceProperties
with additional behavior or functionality. Changes applied to the providedResourceProperties
affect the decorator.- Parameters:
aProperties
- TheResourceProperties
to be decorated.
-
-
Method Detail
-
reload
public Properties reload() throws java.io.IOException, java.lang.IllegalStateException, java.text.ParseException
Reloads theResourceProperties
from the resource to which theResourceProperties
are attached to (such as aFile
as ofResourceProperties.MutableResoureProperties.loadFrom(File)
orResourceProperties.MutableResoureProperties.saveTo(File)
). In case the resource (such as anInputStream
) does not support reloading, then anIllegalStateException
is thrown. Properties existing in the attached resource as well in theProperties
itself are replaced. Properties existing in the attached resource but not(!) in theProperties
itself are not(!) removed. UseResourceProperties.reload(ReloadMode)
with an argument oftrue
(~ orphan removal) to remove properties not existing in the resource.- Specified by:
reload
in interfaceResourceProperties
- Returns:
- The
Properties
as loaded from the resource and applied to this instance. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
reload
public Properties reload(ReloadMode aReloadMode) throws java.io.IOException, java.lang.IllegalStateException, java.text.ParseException
Reloads theResourceProperties
from the resource to which theResourceProperties
are attached to (such as aFile
as ofResourceProperties.MutableResoureProperties.loadFrom(File)
orResourceProperties.MutableResoureProperties.saveTo(File)
). In case the resource (such as anInputStream
) does not support reloading, then anIllegalStateException
is thrown. Properties existing in the attached resource as well in theProperties
itself are replaced. When "orphan removal" is set tofalse
, then properties existing in the attached resource but not(!) in theProperties
itself are not(!) removed. When "orphan removal" is set totrue
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed.- Specified by:
reload
in interfaceResourceProperties
- Parameters:
aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.- Returns:
- The
Properties
as loaded from the resource and applied to this instance. - Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
-