public abstract class AbstractResourcePropertiesBuilder extends PropertiesBuilderImpl implements ResourceProperties.ResourcePropertiesBuilder
ResourceProperties.ResourcePropertiesBuilder
interface.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
ResourceProperties.MutableResourcProperties, 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>
Modifier and Type | Field and Description |
---|---|
protected File |
_propertiesFile |
DEFAULT_COMMENT
Constructor and Description |
---|
AbstractResourcePropertiesBuilder()
Create an empty
AbstractResourcePropertiesBuilder instance using
the default path delimiter "/" (Delimiter.PATH ) for the path
declarations. |
AbstractResourcePropertiesBuilder(Class<?> aResourceClass,
String aFilePath)
Loads the properties from the given file's path.
|
AbstractResourcePropertiesBuilder(Class<?> aResourceClass,
String aFilePath,
boolean isSeekFile)
Loads the properties from the given file's path.
|
AbstractResourcePropertiesBuilder(Class<?> aResourceClass,
String aFilePath,
boolean isSeekFile,
char... aDelimiters)
Loads the properties from the given file's path.
|
AbstractResourcePropertiesBuilder(Class<?> aResourceClass,
String aFilePath,
char... aDelimiters)
Loads the properties from the given file's path.
|
AbstractResourcePropertiesBuilder(File aFile)
Loads the properties from the given
File . |
AbstractResourcePropertiesBuilder(File aFile,
boolean isSeekFile)
Loads or seeks the properties from the given
File . |
AbstractResourcePropertiesBuilder(File aFile,
boolean isSeekFile,
char... aDelimiters)
Loads or seeks the properties from the given
File . |
AbstractResourcePropertiesBuilder(File aFile,
char... aDelimiters)
Loads the properties from the given
File . |
AbstractResourcePropertiesBuilder(InputStream aInputStream)
Reads the properties from the given
InputStream . |
AbstractResourcePropertiesBuilder(InputStream aInputStream,
char... aDelimiters)
Reads the properties from the given
InputStream . |
AbstractResourcePropertiesBuilder(Map<?,?> aProperties)
Create a
AbstractResourcePropertiesBuilder instance containing
the elements of the provided Map instance using the default path
delimiter "/" (Delimiter.PATH ) for the path declarations |
AbstractResourcePropertiesBuilder(Object aObj)
Create a
AbstractResourcePropertiesBuilder instance containing
the elements as of MutablePathMap#insert(Object) using the
default path delimiter "/" (Delimiter.PATH ) for the path
declarations:
"Insects the given object and adds all elements found in the given
object. |
AbstractResourcePropertiesBuilder(Properties.PropertiesBuilder aProperties)
Create a
AbstractResourcePropertiesBuilder instance containing
the elements of the provided PropertiesBuilder instance using the
default path delimiter "/" (Delimiter.PATH ) for the path
declarations |
AbstractResourcePropertiesBuilder(Properties aProperties)
Create a
AbstractResourcePropertiesBuilder instance containing
the elements of the provided Properties instance using the
default path delimiter "/" (Delimiter.PATH ) for the path
declarations |
AbstractResourcePropertiesBuilder(String aFilePath)
Loads the properties from the given file's path.
|
AbstractResourcePropertiesBuilder(String aFilePath,
boolean isSeekFile)
Loads the properties from the given file's path.
|
AbstractResourcePropertiesBuilder(String aFilePath,
boolean isSeekFile,
char... aDelimiters)
Loads the properties from the given file's path.
|
AbstractResourcePropertiesBuilder(String aFilePath,
char... aDelimiters)
Loads the properties from the given file's path.
|
AbstractResourcePropertiesBuilder(URL aUrl)
Loads the properties from the given
URL . |
AbstractResourcePropertiesBuilder(URL aUrl,
char... aDelimiters)
Loads the properties from the given
URL . |
Modifier and Type | Method and Description |
---|---|
void |
flush() |
ResourceProperties.ResourcePropertiesBuilder |
retrieveFrom(String aFromPath) |
ResourceProperties.ResourcePropertiesBuilder |
retrieveTo(String aToPath) |
void |
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() . |
compute, computeIfAbsent, computeIfPresent, containsKey, get, getDelimiter, getOrDefault, getType, merge, put, putIfAbsent, remove, remove, replace, replace, toDataStructure
clear, clone, containsValue, entrySet, forEach, isEmpty, keySet, putAll, replaceAll, size, values
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
retrieve, withInsert, withInsert, withInsertFrom, withInsertTo, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withPut, withPut, withPutBoolean, withPutByte, withPutDouble, withPutFloat, withPutInteger, withPutLong, withPutShort, withRemoveFrom, withSeekFrom, withSeekFrom, withSeekFrom, withSeekFrom, withSeekFrom, withSeekFrom
withPut
put, put, putBoolean, putBoolean, putByte, putByte, putDouble, putDouble, putFloat, putFloat, putInteger, putInteger, putLong, putLong, putShort, putShort
loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, parseFrom, parseFrom, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom
saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, toSerialized, toSerialized
containsValue, delete, put, putAll, putAll, putAll
getType, toMap, toProperties, toPropertyPath
putAll, toDump, toSourceCode
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, insertFrom, 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, toRootPath
protected File _propertiesFile
public AbstractResourcePropertiesBuilder()
AbstractResourcePropertiesBuilder
instance using
the default path delimiter "/" (Delimiter.PATH
) for the path
declarations.public AbstractResourcePropertiesBuilder(Object aObj)
AbstractResourcePropertiesBuilder
instance containing
the elements as of MutablePathMap#insert(Object)
using the
default path delimiter "/" (Delimiter.PATH
) for the path
declarations:
"Insects the given object and adds all elements found in the given
object. Elements of type 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). 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."aObj
- The object from which the elements are to be added.public AbstractResourcePropertiesBuilder(Properties aProperties)
AbstractResourcePropertiesBuilder
instance containing
the elements of the provided Properties
instance using the
default path delimiter "/" (Delimiter.PATH
) for the path
declarationsaProperties
- the properties to be added.public AbstractResourcePropertiesBuilder(Properties.PropertiesBuilder aProperties)
AbstractResourcePropertiesBuilder
instance containing
the elements of the provided PropertiesBuilder
instance using the
default path delimiter "/" (Delimiter.PATH
) for the path
declarationsaProperties
- the properties to be added.public AbstractResourcePropertiesBuilder(Map<?,?> aProperties)
AbstractResourcePropertiesBuilder
instance containing
the elements of the provided Map
instance using the default path
delimiter "/" (Delimiter.PATH
) for the path declarationsaProperties
- the properties to be added.public AbstractResourcePropertiesBuilder(File aFile) throws IOException, ParseException
File
.aFile
- The File
from which to load the properties.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.public AbstractResourcePropertiesBuilder(File aFile, char... aDelimiters) throws IOException, ParseException
File
.aFile
- The File
from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the
source's properties.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.public AbstractResourcePropertiesBuilder(File aFile, boolean isSeekFile) throws IOException, ParseException
File
.
In case you enable the "seek" argument, then the properties are, if the
file does not exist, loaded from the first folder containing such a file
as of the specification for the method
RuntimeUtility.toConfigDirs()
.aFile
- The File
from which to load the properties.isSeekFile
- When true, then the properties are loaded as of the
"seek" functionality described above.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.public AbstractResourcePropertiesBuilder(File aFile, boolean isSeekFile, char... aDelimiters) throws IOException, ParseException
File
.
In case you enable the "seek" argument, then the properties are, if the
file does not exist, loaded from the first folder containing such a file
as of the specification for the method
RuntimeUtility.toConfigDirs()
.aFile
- The File
from which to load the properties.isSeekFile
- When true, then the properties are loaded as of the
"seek" functionality described above.aDelimiters
- The path delimiters to be used when parsing the
source's properties.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.public AbstractResourcePropertiesBuilder(String aFilePath) throws IOException, ParseException
aFilePath
- The path to the file from which to load the properties.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.public AbstractResourcePropertiesBuilder(String aFilePath, char... aDelimiters) throws IOException, ParseException
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.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.public AbstractResourcePropertiesBuilder(Class<?> aResourceClass, String aFilePath) throws IOException, ParseException
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.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.public AbstractResourcePropertiesBuilder(Class<?> aResourceClass, String aFilePath, char... aDelimiters) throws IOException, ParseException
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.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.public AbstractResourcePropertiesBuilder(String aFilePath, boolean isSeekFile) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
.aFilePath
- The path to the file from which to load the properties.isSeekFile
- When true, then the properties are loaded as of the
"seek" functionality described above.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.public AbstractResourcePropertiesBuilder(String aFilePath, boolean isSeekFile, char... aDelimiters) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
.aFilePath
- The path to the file from which to load the properties.isSeekFile
- When true, then the properties are loaded as of the
"seek" functionality described above.aDelimiters
- The path delimiters to be used when parsing the
source's properties.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.public AbstractResourcePropertiesBuilder(Class<?> aResourceClass, String aFilePath, boolean isSeekFile) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
.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.isSeekFile
- When true, then the properties are loaded as of the
"seek" functionality described above.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.public AbstractResourcePropertiesBuilder(Class<?> aResourceClass, String aFilePath, boolean isSeekFile, char... aDelimiters) throws IOException, ParseException
RuntimeUtility.toConfigDirs()
.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.isSeekFile
- When true, then the properties are loaded as of the
"seek" functionality described above.aDelimiters
- The path delimiters to be used when parsing the
source's properties.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.public AbstractResourcePropertiesBuilder(URL aUrl) throws IOException, ParseException
URL
.aUrl
- The URL
from which to read the properties.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.public AbstractResourcePropertiesBuilder(URL aUrl, char... aDelimiters) throws IOException, ParseException
URL
.aUrl
- The URL
from which to read the properties.aDelimiters
- The path delimiters to be used when parsing the
source's properties.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.public AbstractResourcePropertiesBuilder(InputStream aInputStream) throws IOException, ParseException
InputStream
.aInputStream
- The InputStream
from which to read the
properties.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.public AbstractResourcePropertiesBuilder(InputStream aInputStream, char... aDelimiters) throws IOException, ParseException
InputStream
.aInputStream
- The InputStream
from which to read the
properties.aDelimiters
- The path delimiters to be used when parsing the
source's properties.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.public void seekFrom(Class<?> aResourceClass, String aFilePath, char... aDelimiters) throws IOException, ParseException
ResourceProperties.MutableResourcProperties
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
ResourceProperties.MutableResourcProperties.loadFrom(InputStream, char...)
to finally load and parse the
properties.seekFrom
in interface ResourceProperties.MutableResourcProperties
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).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.public void flush() throws IOException
flush
in interface Flushable
IOException
public ResourceProperties.ResourcePropertiesBuilder retrieveFrom(String aFromPath)
retrieveFrom
in interface Properties
retrieveFrom
in interface Properties.MutableProperties
retrieveFrom
in interface Properties.PropertiesBuilder
retrieveFrom
in interface ResourceProperties
retrieveFrom
in interface ResourceProperties.MutableResourcProperties
retrieveFrom
in interface ResourceProperties.ResourcePropertiesBuilder
retrieveFrom
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
retrieveFrom
in interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap
retrieveFrom
in interface org.refcodes.structure.PathMap<String>
retrieveFrom
in interface org.refcodes.structure.PathMap.MutablePathMap<String>
retrieveFrom
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
retrieveFrom
in class PropertiesBuilderImpl
public ResourceProperties.ResourcePropertiesBuilder retrieveTo(String aToPath)
retrieveTo
in interface Properties
retrieveTo
in interface Properties.MutableProperties
retrieveTo
in interface Properties.PropertiesBuilder
retrieveTo
in interface ResourceProperties
retrieveTo
in interface ResourceProperties.MutableResourcProperties
retrieveTo
in interface ResourceProperties.ResourcePropertiesBuilder
retrieveTo
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
retrieveTo
in interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap
retrieveTo
in interface org.refcodes.structure.PathMap<String>
retrieveTo
in interface org.refcodes.structure.PathMap.MutablePathMap<String>
retrieveTo
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
retrieveTo
in class PropertiesBuilderImpl
Copyright © 2017. All rights reserved.