public static interface ResourceProperties.MutableResoureProperties extends ResourceProperties, Properties.MutableProperties, org.refcodes.component.Flushable
ResourceProperties.MutableResoureProperties
defines "dirty" methods
allowing to modify ("mutate") the ResourceProperties
.ResourceProperties.MutableResoureProperties, ResourceProperties.ResourcePropertiesBuilder
Properties.MutableProperties, Properties.PropertiesBuilder
org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap
org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<T>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
org.refcodes.structure.PathMap.MutablePathMap<T>, org.refcodes.structure.PathMap.PathMapBuilder<T>
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
org.refcodes.mixin.TypeAccessor.TypeMutator<T>, org.refcodes.mixin.TypeAccessor.TypeProperty<T>
org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K,V,B extends org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K,V,B>>
org.refcodes.structure.Dictionary.MutableDictionary<K,V>
DEFAULT_COMMENT
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flushes
ResourceProperties.MutableResoureProperties to the resource to which the
ResourceProperties are attached to (such as a File as
of loadFrom(File) or
ResourceProperties.saveTo(File) ). |
default Properties |
loadFrom(Class<?> aResourceClass,
String aFilePath)
Loads the properties from the given class resource (from inside a
JAR).
|
default Properties |
loadFrom(Class<?> aResourceClass,
String aFilePath,
char... aDelimiters)
Loads the properties from the given class resource (from inside a
JAR).
|
default Properties |
loadFrom(File aFile)
Loads the properties from the given
File . |
Properties |
loadFrom(File aFile,
char... aDelimiters)
Loads the properties from the given
File . |
default Properties |
loadFrom(InputStream aInputStream)
Loads the properties from the given
InputStream . |
Properties |
loadFrom(InputStream aInputStream,
char... aDelimiters)
Loads the properties from the given
InputStream . |
default Properties |
loadFrom(String aFilePath)
Loads the properties from the given file path's
File . |
default Properties |
loadFrom(String aFilePath,
char... aDelimiters)
Loads the properties from the given file path's
File . |
default Properties |
loadFrom(URL aUrl)
Loads the properties from the given
URL . |
default Properties |
loadFrom(URL aUrl,
char... aDelimiters)
Loads the properties from the given
URL . |
default void |
parseFrom(String aSerialized)
Inspects the given serialized representation and adds all declared
elements found.
|
default void |
parseFrom(String aSerialized,
char... aDelimiters)
Inspects the given serialized representation and adds all declared
elements found.
|
default Properties |
seekFrom(Class<?> aResourceClass,
String aFilePath)
Loads a properties file from the file path directly or (if not found)
from the first folder containing such a file as of the specification
for the method
RuntimeUtility.toConfigDirs() . |
Properties |
seekFrom(Class<?> aResourceClass,
String aFilePath,
char... aDelimiters)
Loads a properties file from the file path directly or (if not found)
from the first folder containing such a file as of the specification
for the method
RuntimeUtility.toConfigDirs() . |
default Properties |
seekFrom(File aFile)
Loads a properties file from the file directly or (if not found) from
first folder containing such a file as of the specification for the
method
RuntimeUtility.toConfigDirs() . |
default Properties |
seekFrom(File aFile,
char... aDelimiters)
Loads a properties file from the file directly or (if not found) from
first folder containing such a file as of the specification for the
method
RuntimeUtility.toConfigDirs() . |
default Properties |
seekFrom(String aFilePath)
Loads a properties file from the file path directly or (if not found)
from the first folder containing such a file as of the specification
for the method
RuntimeUtility.toConfigDirs() . |
default Properties |
seekFrom(String aFilePath,
char... aDelimiters)
Loads a properties file from the file path directly or (if not found)
from the first folder containing such a file as of the specification
for the method
RuntimeUtility.toConfigDirs() . |
fileTo, fileTo, fileTo, fileTo, fileTo, fileTo, fileTo, fileTo, reload, reload, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, toSerialized, toSerialized
containsValue, delete, delete, insert, insert, insertFrom, insertTo, put, putAll, putAll, putAll
childrenOf, getType, retrieve, retrieveFrom, retrieveTo, toMap, toProperties, toPropertyPath
insert, insert, insertFrom, insertTo, putAll, toDump, toSourceCode, toSourceCode
toInstance, toInstance, toType, toType
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
insert, insert, insert, insert, insertFrom, insertFrom, insertTo, insertTo, put, putArray, putArray, removeAll
directories, directories, entries, entries, fromExternalKey, getArray, getArray, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, toDataStructure, toDataStructure, toExternalKey, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath, toRootPath
clear, compute, computeIfAbsent, computeIfPresent, containsKey, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
void flush() throws org.refcodes.component.OpenException
ResourceProperties.MutableResoureProperties
to the resource to which the
ResourceProperties
are attached to (such as a File
as
of loadFrom(File)
or
ResourceProperties.saveTo(File)
).
default Properties loadFrom(String aFilePath) throws IOException, ParseException
File
. Save
them using the method ResourceProperties.saveTo(String)
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aFilePath
- The file path from which to load the properties.Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded..default Properties loadFrom(Class<?> aResourceClass, String aFilePath) throws IOException, ParseException
loadFrom(InputStream, char...)
to finally load and parse the
properties.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.Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties loadFrom(String aFilePath, char... aDelimiters) throws IOException, ParseException
File
. Save
them using the method ResourceProperties.saveTo(String, char)
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aFilePath
- The file path from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the
source's properties (in case the the serialized format
supports / requires the such).Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties loadFrom(Class<?> aResourceClass, String aFilePath, char... aDelimiters) throws IOException, ParseException
loadFrom(InputStream, char...)
to finally load and parse the
properties.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 (in case the the serialized format
supports / requires the such).Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties loadFrom(File aFile) throws IOException, ParseException
File
. Save them using the
method ResourceProperties.saveTo(File)
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aFile
- The File
from which to load the properties.Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.Properties loadFrom(File aFile, char... aDelimiters) throws IOException, ParseException
File
. Save them using the
method ResourceProperties.saveTo(File)
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aFile
- The File
from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the
source's properties (in case the the serialized format
supports / requires the such).Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties loadFrom(URL aUrl) throws IOException, ParseException
URL
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aUrl
- The URL
from which to load the properties.Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties loadFrom(URL aUrl, char... aDelimiters) throws IOException, ParseException
URL
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aUrl
- The URL
from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the
source's properties (in case the the serialized format
supports / requires the such).Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties loadFrom(InputStream aInputStream) throws IOException, ParseException
InputStream
. Save them
using the method ResourceProperties.saveTo(OutputStream)
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aInputStream
- The InputStream
from which to load the
properties.Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.Properties loadFrom(InputStream aInputStream, char... aDelimiters) throws IOException, ParseException
InputStream
. Save them
using the method ResourceProperties.saveTo(OutputStream)
.
This is the hook-method of the default implementation for loading the
properties. In case you want to implement ResourceProperties
which support other notations than the properties notation
(path=value
), then you overwrite this method in your
implementation accordingly.aInputStream
- The InputStream
from which to load the
properties.aDelimiters
- The path delimiters to be used when parsing the
source's properties (in case the the serialized format
supports / requires the such).Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case loading the properties failedParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default void parseFrom(String aSerialized) throws ParseException
Map
,
Collection
and arrays are identified and handled as of their
type: The path for each value in a Map
is appended with its
according key. The path for each value in a Collection
or
array is appended with its according index of occurrence (in case of
a List
or an array, its actual index).
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aSerialized
- The serialized representation which is to be
parsed for the therein declared elements being added with
their according determined paths.ParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default void parseFrom(String aSerialized, char... aDelimiters) throws ParseException
Map
,
Collection
and arrays are identified and handled as of their
type: The path for each value in a Map
is appended with its
according key. The path for each value in a Collection
or
array is appended with its according index of occurrence (in case of
a List
or an array, its actual index).
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aSerialized
- The serialized representation which is to be
parsed for the therein declared elements being added with
their according determined paths.aDelimiters
- The path delimiters to be used when parsing the
source's properties (in case the the serialized format
supports / requires the such).ParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties seekFrom(File aFile) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aFile
- The file of the properties file to load.Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case accessing or processing the
properties file failed.ParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties seekFrom(File aFile, char... aDelimiters) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aFile
- The file of the properties file to load.aDelimiters
- The path delimiters to be used when parsing the
source's properties (in case the the serialized format
supports / requires the such).Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case accessing or processing the
properties file failed.ParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties seekFrom(String aFilePath) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aFilePath
- The file path from which to load the properties.Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case accessing or processing the
properties file failed.ParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties seekFrom(Class<?> aResourceClass, String aFilePath) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
. 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).
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aResourceClass
- The class which's class loader is to take care
of loading the properties (from inside a JAR).aFilePath
- The file path from which to load the properties.Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case accessing or processing the
properties file failed.ParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.default Properties seekFrom(String aFilePath, char... aDelimiters) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
.
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aFilePath
- The file path from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the
source's properties (in case the the serialized format
supports / requires the such).Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case accessing or processing the
properties file failed.ParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.Properties seekFrom(Class<?> aResourceClass, String aFilePath, char... aDelimiters) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
. 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).
The default implementation uses the hook method
loadFrom(InputStream, char...)
to finally load and parse the
properties.aResourceClass
- The class which's class loader is to take care
of loading the properties (from inside a JAR).aFilePath
- The file path from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the
source's properties (in case the the serialized format
supports / requires the such).Properties
as loaded from the resource and
applied to this instance.IOException
- thrown in case accessing or processing the
properties file failed.ParseException
- Signals that an error has been reached
unexpectedly while parsing the data to be loaded.Copyright © 2018. All rights reserved.