Package org.refcodes.configuration
Class JsonProperties
- java.lang.Object
-
- org.refcodes.configuration.AbstractResourceProperties
-
- org.refcodes.configuration.JsonProperties
-
- All Implemented Interfaces:
Properties
,ResourceProperties
,org.refcodes.mixin.AnnotatorAccessor
,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,T>
,org.refcodes.structure.Keys<java.lang.String,T>
,org.refcodes.structure.PathMap<java.lang.String>
,org.refcodes.structure.PropertiesAccessorMixin
public class JsonProperties extends AbstractResourceProperties implements ResourceProperties
Implementation of theResourceProperties
interface with support of so called "JSON properties". For JSON properties, see "https://en.wikipedia.org/wiki/JSON"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JsonProperties.JsonPropertiesFactory
TheJsonProperties.JsonPropertiesFactory
represents aResourcePropertiesFactory
creating instances of typeJsonProperties
.-
Nested classes/interfaces inherited from interface org.refcodes.mixin.AnnotatorAccessor
org.refcodes.mixin.AnnotatorAccessor.AnnotatorBuilder<B extends org.refcodes.mixin.AnnotatorAccessor.AnnotatorBuilder<B>>, org.refcodes.mixin.AnnotatorAccessor.AnnotatorMutator, org.refcodes.mixin.AnnotatorAccessor.AnnotatorProperty
-
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 class org.refcodes.configuration.AbstractResourceProperties
_properties
-
Fields inherited from interface org.refcodes.configuration.Properties
DEFAULT_COMMENT
-
-
Constructor Summary
Constructors Constructor Description JsonProperties(java.io.File aFile)
Loads the JSON Properties from the givenFile
.JsonProperties(java.io.File aFile, char... aDelimiters)
Loads the JSON Properties from the givenFile
.JsonProperties(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator)
Loads or seeks the JSON Properties from the givenFile
.JsonProperties(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters)
Loads or seeks the JSON Properties from the givenFile
.JsonProperties(java.io.InputStream aInputStream)
Reads the JSON Properties from the givenInputStream
.JsonProperties(java.io.InputStream aInputStream, char... aDelimiters)
Reads the JSON Properties from the givenInputStream
.JsonProperties(java.lang.Class<?> aResourceClass, java.lang.String aFilePath)
Loads the JSON Properties from the given file's path.JsonProperties(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, char... aDelimiters)
Loads the JSON Properties from the given file's path.JsonProperties(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator)
Loads the JSON Properties from the given file's path.JsonProperties(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters)
Loads the JSON Properties from the given file's path.JsonProperties(java.lang.Object aObj)
Create aJsonProperties
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations: "Inspects the given object and adds all elements found in the given object.JsonProperties(java.lang.String aFilePath)
Loads the JSON Properties from the given file's path.JsonProperties(java.lang.String aFilePath, char... aDelimiters)
Loads the JSON Properties from the given file's path.JsonProperties(java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator)
Loads the JSON Properties from the given file's path.JsonProperties(java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters)
Loads the JSON Properties from the given file's path.JsonProperties(java.net.URL aUrl)
Loads the JSON Properties from the givenURL
.JsonProperties(java.net.URL aUrl, char... aDelimiters)
Loads the JSON Properties from the givenURL
.JsonProperties(java.util.Map<?,?> aProperties)
Create aJsonProperties
instance containing the elements of the providedMap
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarationsJsonProperties(Properties aProperties)
Create aJsonProperties
instance containing the elements of the providedProperties
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarationsJsonProperties(Properties.PropertiesBuilder aProperties)
Create aJsonProperties
instance containing the elements of the providedProperties.PropertiesBuilder
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.Object aKey)
java.lang.String
get(java.lang.Object aKey)
char
getDelimiter()
Returns the default path delimiter as ofDelimiter.PATH
.java.lang.Class<java.lang.String>
getType()
boolean
isEmpty()
java.util.Set<java.lang.String>
keySet()
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)
).Properties
retrieveFrom(java.lang.String aFromPath)
Properties
retrieveTo(java.lang.String aToPath)
int
size()
java.lang.Object
toDataStructure(java.lang.String aFromPath)
java.util.Collection<java.lang.String>
values()
-
Methods inherited from class org.refcodes.configuration.AbstractResourceProperties
toSerialized, toSerialized
-
Methods inherited from interface org.refcodes.structure.CanonicalMap
getBoolean, getBoolean, getBooleanOr, getBooleanOr, getByte, getByte, getByteOr, getByteOr, getCharacter, getCharacter, getCharacterOr, getCharacterOr, getDouble, getDouble, getDoubleOr, getDoubleOr, getFloat, getFloat, getFloatOr, getFloatOr, getInteger, getInteger, getIntegerOr, getIntegerOr, getLong, getLong, getLongOr, getLongOr, getShort, getShort, getShortOr, getShortOr, queryBetween, toInstance, toInstance, toMap, toProperties, 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
children, children, children, children, children, children, containsKey, containsKey, containsKey, dirs, dirs, dirs, dirs, dirs, dirs, findPaths, fromExternalPath, get, get, get, getArray, getArray, getArray, getArray, getArray, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getDirAt, getDirAt, getDirAt, getDirAt, getDirIndexes, getDirIndexes, getDirIndexes, getDirIndexes, getDirIndexes, getRootPath, getValueAt, getValueAt, getValueAt, getValueAt, getValueAt, getValueAt, hasChildren, hasChildren, hasChildren, hasChildren, hasChildren, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasParentPath, hasPath, hasPath, hasPath, hasPath, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, isArray, isArray, isArray, isArray, isArray, isArray, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isChild, isChild, isChild, isChild, isDir, isDir, isDir, isDir, isDir, isDirIndex, isDirIndex, isDirIndex, isDirIndex, isDirIndex, isEqualTo, isLeaf, isLeaf, isLeaf, isLeaf, isLeaf, isRootPath, keySet, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, leaves, leaves, leaves, leaves, leaves, leaves, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, paths, paths, paths, paths, paths, paths, queryPaths, queryPaths, queryPaths, queryPaths, queryPaths, queryPaths, sortedKeys, toDataStructure, toExternalPath, toLeaf, toMap, toNormalizedPath, toParentPath, toPath, toPath, toPath, toPathElements, toPathList, toPathStack, toPropertyPath
-
Methods inherited from interface org.refcodes.configuration.Properties
containsValue, getAnnotator, getDirAt, getDirAt, query, query, query, query, query, queryBetween, queryBetween, queryBetween, queryBetween, queryBetween, queryFrom, queryFrom, queryFrom, queryFrom, queryFrom, queryFrom, queryTo, queryTo, queryTo, queryTo, queryTo, queryTo, retrieveBetween, retrieveBetween, retrieveBetween, retrieveBetween, retrieveBetween, retrieveFrom, retrieveFrom, retrieveFrom, retrieveFrom, retrieveTo, retrieveTo, retrieveTo, retrieveTo
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin
asArray, asArray, asArray, asArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asByteArray, asByteArray, asByteArray, asByteArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asLongArray, asLongArray, asLongArray, asLongArray, asShortArray, asShortArray, asShortArray, asShortArray, getBoolean, getBoolean, getBooleanOr, getBooleanOr, getByte, getByte, getByteOr, getByteOr, getCharacter, getCharacter, getCharacterOr, getCharacterOr, getDouble, getDouble, getDoubleOr, getDoubleOr, getFloat, getFloat, getFloatOr, getFloatOr, getInteger, getInteger, getIntegerOr, getIntegerOr, getLong, getLong, getLongOr, getLongOr, getShort, getShort, getShortOr, getShortOr
-
Methods inherited from interface org.refcodes.configuration.ResourceProperties
toSerialized, toSerialized
-
-
-
-
Constructor Detail
-
JsonProperties
public JsonProperties(java.lang.Object aObj)
Create aJsonProperties
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations: "Inspects the given object and adds all elements found in the given object. Elements of typeMap
,Collection
and arrays are identified and handled as of their type: The path for each value in aMap
is appended with its according key. The path for each value in aCollection
or array is appended with its according index of occurrence (in case of aList
or an array, its actual index). In case of reflection, the path for each member is appended with its according mamber's name. All elements (e.g. the members and values) are inspected recursively which results in the according paths of the terminating values."- Parameters:
aObj
- The object from which the elements are to be added.
-
JsonProperties
public JsonProperties(Properties aProperties)
Create aJsonProperties
instance containing the elements of the providedProperties
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations- Parameters:
aProperties
- the properties to be added.
-
JsonProperties
public JsonProperties(Properties.PropertiesBuilder aProperties)
Create aJsonProperties
instance containing the elements of the providedProperties.PropertiesBuilder
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations- Parameters:
aProperties
- the properties to be added.
-
JsonProperties
public JsonProperties(java.util.Map<?,?> aProperties)
Create aJsonProperties
instance containing the elements of the providedMap
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations- Parameters:
aProperties
- the properties to be added.
-
JsonProperties
public JsonProperties(java.io.File aFile) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the givenFile
.- Parameters:
aFile
- TheFile
from which to load the properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.io.File aFile, char... aDelimiters) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the givenFile
.- Parameters:
aFile
- TheFile
from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator) throws java.io.IOException, java.text.ParseException
Loads or seeks the JSON Properties from the givenFile
. A providedConfigLocator
describes the locations to additional crawl for the desired file.- Parameters:
aFile
- TheFile
from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) throws java.io.IOException, java.text.ParseException
Loads or seeks the JSON Properties from the givenFile
. A providedConfigLocator
describes the locations to additional crawl for the desired file.- Parameters:
aFile
- TheFile
from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the given file's path.- Parameters:
aFilePath
- The path to the file from which to load the properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.lang.String aFilePath, char... aDelimiters) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the given file's path.- Parameters:
aFilePath
- The path to the file from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.lang.Class<?> aResourceClass, java.lang.String aFilePath) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the given file's path.- Parameters:
aResourceClass
- The class which's class loader is to take care of loading the properties (from inside a JAR).aFilePath
- The file path of the class's resources from which to load the properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, char... aDelimiters) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the given file's path.- Parameters:
aResourceClass
- The class which's class loader is to take care of loading the properties (from inside a JAR).aFilePath
- The file path of the class's resources from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the given file's path. A providedConfigLocator
describes the locations to additional crawl for the desired file.- Parameters:
aFilePath
- The path to the file from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the given file's path. A providedConfigLocator
describes the locations to additional crawl for the desired file.- Parameters:
aFilePath
- The path to the file from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the given file's path. A providedConfigLocator
describes the locations to additional crawl for the desired file. Finally (if nothing else succeeds) the properties are loaded by the provided class's class loader which takes care of loading the properties (in case the file path is a relative path, also the absolute path with a prefixed path delimiter "/" is probed).- Parameters:
aResourceClass
- The class which's class loader is to take care of loading the properties (from inside a JAR).aFilePath
- The file path of the class's resources from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the given file's path. A providedConfigLocator
describes the locations to additional crawl for the desired file. Finally (if nothing else succeeds) the properties are loaded by the provided class's class loader which takes care of loading the properties (in case the file path is a relative path, also the absolute path with a prefixed path delimiter "/" is probed).- Parameters:
aResourceClass
- The class which's class loader is to take care of loading the properties (from inside a JAR).aFilePath
- The file path of the class's resources from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.net.URL aUrl) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the givenURL
.- Parameters:
aUrl
- TheURL
from which to read the properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.net.URL aUrl, char... aDelimiters) throws java.io.IOException, java.text.ParseException
Loads the JSON Properties from the givenURL
.- Parameters:
aUrl
- TheURL
from which to read the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.io.InputStream aInputStream) throws java.io.IOException, java.text.ParseException
Reads the JSON Properties from the givenInputStream
.- Parameters:
aInputStream
- TheInputStream
from which to read the properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
JsonProperties
public JsonProperties(java.io.InputStream aInputStream, char... aDelimiters) throws java.io.IOException, java.text.ParseException
Reads the JSON Properties from the givenInputStream
.- Parameters:
aInputStream
- TheInputStream
from which to read the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Throws:
java.io.IOException
- thrown in case accessing or processing the properties file failed.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
-
Method Detail
-
containsKey
public boolean containsKey(java.lang.Object aKey)
- Specified by:
containsKey
in interfaceorg.refcodes.structure.Keys<java.lang.String,T extends java.lang.Object>
-
get
public java.lang.String get(java.lang.Object aKey)
- Specified by:
get
in interfaceorg.refcodes.structure.Keys<java.lang.String,T extends java.lang.Object>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySet
in interfaceorg.refcodes.structure.Keys<java.lang.String,T extends java.lang.Object>
-
values
public java.util.Collection<java.lang.String> values()
- Specified by:
values
in interfaceorg.refcodes.structure.Keys<java.lang.String,T extends java.lang.Object>
-
size
public int size()
- Specified by:
size
in interfaceorg.refcodes.structure.Containable
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceorg.refcodes.structure.Containable
-
retrieveFrom
public Properties retrieveFrom(java.lang.String aFromPath)
- Specified by:
retrieveFrom
in interfaceorg.refcodes.structure.CanonicalMap
- Specified by:
retrieveFrom
in interfaceorg.refcodes.structure.PathMap<java.lang.String>
- Specified by:
retrieveFrom
in interfaceProperties
-
retrieveTo
public Properties retrieveTo(java.lang.String aToPath)
- Specified by:
retrieveTo
in interfaceorg.refcodes.structure.CanonicalMap
- Specified by:
retrieveTo
in interfaceorg.refcodes.structure.PathMap<java.lang.String>
- Specified by:
retrieveTo
in interfaceProperties
-
getDelimiter
public char getDelimiter()
Returns the default path delimiter as ofDelimiter.PATH
.- Specified by:
getDelimiter
in interfaceorg.refcodes.mixin.DelimiterAccessor
- Specified by:
getDelimiter
in interfaceProperties
-
getType
public java.lang.Class<java.lang.String> getType()
- Specified by:
getType
in interfaceProperties
- Specified by:
getType
in interfaceorg.refcodes.mixin.TypeAccessor<java.lang.String>
-
toDataStructure
public java.lang.Object toDataStructure(java.lang.String aFromPath)
- Specified by:
toDataStructure
in interfaceorg.refcodes.structure.PathMap<java.lang.String>
-
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.
-
-