Class JsonPropertiesBuilder

  • All Implemented Interfaces:
    java.io.Flushable, java.util.Map<java.lang.String,T>, org.refcodes.component.Flushable, org.refcodes.component.Flushable.FlushBuilder<java.lang.String>, Properties, Properties.MutableProperties, Properties.PropertiesBuilder, ResourceProperties, ResourceProperties.MutableResoureProperties, ResourceProperties.ResourcePropertiesBuilder, org.refcodes.mixin.DelimiterAccessor, org.refcodes.mixin.Dumpable, org.refcodes.mixin.TypeAccessor<java.lang.String>, org.refcodes.structure.CanonicalMap, org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap, org.refcodes.structure.Clearable, org.refcodes.structure.Containable, org.refcodes.structure.Dictionary<java.lang.String,T>, org.refcodes.structure.Dictionary.MutableDictionary<java.lang.String,T>, org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<java.lang.String,T,org.refcodes.structure.PathMap.PathMapBuilder<T>>, org.refcodes.structure.Keys<java.lang.String,T>, org.refcodes.structure.Keys.MutableKeys<java.lang.String,T>, org.refcodes.structure.Keys.MutableValues<java.lang.String,T>, org.refcodes.structure.PathMap<java.lang.String>, org.refcodes.structure.PathMap.MutablePathMap<java.lang.String>, org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>, org.refcodes.structure.PropertiesAccessorMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<java.lang.String>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin


    public class JsonPropertiesBuilder
    extends AbstractResourcePropertiesBuilder
    implements ResourceProperties.ResourcePropertiesBuilder
    Implementation of the ResourceProperties.ResourcePropertiesBuilder interface with support of so called "JSON properties" (or just "properties"). For JSON, see "https://en.wikipedia.org/wiki/JSON".
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JsonPropertiesBuilder.JsonPropertiesBuilderFactory
      • 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.Dictionary.MutableDictionary

        org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K extends java.lang.Object,V extends java.lang.Object,B extends org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K,V,B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.Flushable

        org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
      • 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.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.mixin.TypeAccessor

        org.refcodes.mixin.TypeAccessor.TypeMutator<T extends java.lang.Object>, org.refcodes.mixin.TypeAccessor.TypeProperty<T extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonPropertiesBuilder​()
      Create an empty JsonPropertiesBuilder instance using the default path delimiter "/" (Delimiter.PATH) for the path declarations.
      JsonPropertiesBuilder​(java.io.File aFile)
      Loads the JSON properties from the given File.
      JsonPropertiesBuilder​(java.io.File aFile, char... aDelimiters)
      Loads the JSON properties from the given File.
      JsonPropertiesBuilder​(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator)
      Loads or seeks the JSON properties from the given File.
      JsonPropertiesBuilder​(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters)
      Loads or seeks the JSON properties from the given File.
      JsonPropertiesBuilder​(java.io.InputStream aInputStream)
      Reads the JSON properties from the given InputStream.
      JsonPropertiesBuilder​(java.io.InputStream aInputStream, char... aDelimiters)
      Reads the JSON properties from the given InputStream.
      JsonPropertiesBuilder​(java.lang.Class<?> aResourceClass, java.lang.String aFilePath)
      Loads the JSON properties from the given file's path.
      JsonPropertiesBuilder​(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, char... aDelimiters)
      Loads the JSON properties from the given file's path.
      JsonPropertiesBuilder​(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator)
      Loads the JSON properties from the given file's path.
      JsonPropertiesBuilder​(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.
      JsonPropertiesBuilder​(java.lang.Object aObj)
      Create a JsonPropertiesBuilder instance containing the elements as of PathMap.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.
      JsonPropertiesBuilder​(java.lang.String aFilePath)
      Loads the JSON properties from the given file's path.
      JsonPropertiesBuilder​(java.lang.String aFilePath, char... aDelimiters)
      Loads the JSON properties from the given file's path.
      JsonPropertiesBuilder​(java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator)
      Loads the JSON properties from the given file's path.
      JsonPropertiesBuilder​(java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters)
      Loads the JSON properties from the given file's path.
      JsonPropertiesBuilder​(java.net.URL aUrl)
      Loads the JSON properties from the given URL.
      JsonPropertiesBuilder​(java.net.URL aUrl, char... aDelimiters)
      Loads the JSON properties from the given URL.
      JsonPropertiesBuilder​(java.util.Map<?,?> aProperties)
      Create a JsonPropertiesBuilder instance containing the elements of the provided Map instance using the default path delimiter "/" (Delimiter.PATH) for the path declarations
      JsonPropertiesBuilder​(Properties aProperties)
      Create a JsonPropertiesBuilder instance containing the elements of the provided Properties instance using the default path delimiter "/" (Delimiter.PATH) for the path declarations
      JsonPropertiesBuilder​(Properties.PropertiesBuilder aProperties)
      Create a JsonPropertiesBuilder instance containing the elements of the provided Properties.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
      Properties loadFrom​(java.io.InputStream aInputStream, char... aDelimiters)
      Loads the properties from the given InputStream.
      void saveTo​(java.io.OutputStream aOutputStream, java.lang.String aComment, char aDelimiter)
      The comment is ignored for the JSON format as JSON does not(!)
      • Methods inherited from interface org.refcodes.structure.CanonicalMap

        getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort, toInstance, toInstance, toType, toType
      • Methods inherited from interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder

        withInsert, withInsert, withInsertFrom, withInsertTo
      • Methods inherited from interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap

        insert, insert, insertFrom, insertTo, putAll, toDump, toSourceCode, toSourceCode
      • Methods inherited from interface org.refcodes.structure.Containable

        isEmpty, size
      • Methods inherited from interface org.refcodes.mixin.Dumpable

        toDump
      • Methods inherited from interface org.refcodes.component.Flushable

        flushUnchecked, isFlushable
      • Methods inherited from interface org.refcodes.component.Flushable.FlushBuilder

        withFlush, withFlushUnchecked
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.refcodes.structure.PathMap

        children, children, children, children, children, dirs, dirs, dirs, dirs, dirs, fromExternalPath, get, get, getArray, getArray, getArray, getArray, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getDirAt, getDirAt, getDirAt, getDirIndexes, getDirIndexes, getDirIndexes, getDirIndexes, getRootPath, getValueAt, getValueAt, getValueAt, getValueAt, getValueAt, hasChildren, hasChildren, hasChildren, hasChildren, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasParentPath, hasPath, hasValueAt, hasValueAt, hasValueAt, hasValueAt, isArray, isArray, isArray, isArray, isArray, isChild, isChild, isChild, isDir, isDir, isDir, isDir, isDirectory, isDirectory, isDirectory, isDirectory, isRecord, isRecord, isRecord, isRecord, isRootPath, keySet, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, paths, paths, paths, paths, paths, queryPaths, records, records, records, records, records, toDataStructure, toDataStructure, toExternalPath, toLeaf, toMap, toNormalizedPath, toParentPath, toPath, toPath, toPath, toPathElements
      • Methods inherited from interface org.refcodes.structure.PathMap.MutablePathMap

        appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendValueTo, appendValueTo, appendValueTo, appendValueTo, insert, insert, insert, insert, insertFrom, insertFrom, insertTo, insertTo, put, put, put, putArray, putArray, putArray, putArray, putArray, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putValueAt, putValueAt, putValueAt, putValueAt, putValueAt, remove, remove, removeValueAt, removeValueAt, removeValueAt, removeValueAt, removeValueAt
      • Methods inherited from interface org.refcodes.structure.PathMap.PathMapBuilder

        withInsert, withInsert, withInsertFrom, withInsertTo
      • Methods inherited from class org.refcodes.structure.PathMapBuilderImpl

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, createBackingMap, entrySet, equals, forEach, get, getDelimiter, getOrDefault, getType, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, toDataStructure, toString, values
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin

        asArray, asArray, asArray, asArray, asArray, asArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asByteArray, asByteArray, asByteArray, asByteArray, asByteArray, asByteArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asLongArray, asLongArray, asLongArray, asLongArray, asLongArray, asLongArray, asShortArray, asShortArray, asShortArray, asShortArray, asShortArray, asShortArray, containsKey, get, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCharacter, getCharacter, getCharacter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getShort, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin

        withPut
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin

        put, put, putBoolean, putBoolean, putByte, putByte, putDouble, putDouble, putFloat, putFloat, putInteger, putInteger, putLong, putLong, putShort, putShort
    • Constructor Detail

      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​()
        Create an empty JsonPropertiesBuilder instance using the default path delimiter "/" (Delimiter.PATH) for the path declarations.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(java.lang.Object aObj)
        Create a JsonPropertiesBuilder instance containing the elements as of PathMap.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 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."
        Parameters:
        aObj - The object from which the elements are to be added.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(Properties aProperties)
        Create a JsonPropertiesBuilder instance containing the elements of the provided Properties instance using the default path delimiter "/" (Delimiter.PATH) for the path declarations
        Parameters:
        aProperties - the properties to be added.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(java.util.Map<?,?> aProperties)
        Create a JsonPropertiesBuilder instance containing the elements of the provided Map instance using the default path delimiter "/" (Delimiter.PATH) for the path declarations
        Parameters:
        aProperties - the properties to be added.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(java.io.File aFile)
                              throws java.io.IOException,
                                     java.text.ParseException
        Loads the JSON properties from the given File.
        Parameters:
        aFile - 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(java.io.File aFile,
                                     char... aDelimiters)
                              throws java.io.IOException,
                                     java.text.ParseException
        Loads the JSON properties from the given File.
        Parameters:
        aFile - 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(java.io.File aFile,
                                     org.refcodes.runtime.ConfigLocator aConfigLocator)
                              throws java.io.IOException,
                                     java.text.ParseException
        Loads or seeks the JSON properties from the given File. A provided ConfigLocator describes the locations to additional crawl for the desired file.
        Parameters:
        aFile - The File from which to load the properties.
        aConfigLocator - The ConfigLocator 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(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 given File. A provided ConfigLocator describes the locations to additional crawl for the desired file.
        Parameters:
        aFile - The File from which to load the properties.
        aConfigLocator - The ConfigLocator 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(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 provided ConfigLocator describes the locations to additional crawl for the desired file.
        Parameters:
        aFilePath - The path to the file from which to load the properties.
        aConfigLocator - The ConfigLocator 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(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 provided ConfigLocator describes the locations to additional crawl for the desired file.
        Parameters:
        aFilePath - The path to the file from which to load the properties.
        aConfigLocator - The ConfigLocator 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(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 provided ConfigLocator 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 - The ConfigLocator 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(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 provided ConfigLocator 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 - The ConfigLocator 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(java.net.URL aUrl)
                              throws java.io.IOException,
                                     java.text.ParseException
        Loads the JSON properties from the given URL.
        Parameters:
        aUrl - The URL 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(java.net.URL aUrl,
                                     char... aDelimiters)
                              throws java.io.IOException,
                                     java.text.ParseException
        Loads the JSON properties from the given URL.
        Parameters:
        aUrl - The URL 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(java.io.InputStream aInputStream)
                              throws java.io.IOException,
                                     java.text.ParseException
        Reads the JSON properties from the given InputStream.
        Parameters:
        aInputStream - The InputStream 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.
      • JsonPropertiesBuilder

        public JsonPropertiesBuilder​(java.io.InputStream aInputStream,
                                     char... aDelimiters)
                              throws java.io.IOException,
                                     java.text.ParseException
        Reads the JSON properties from the given InputStream.
        Parameters:
        aInputStream - The InputStream 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

      • loadFrom

        public Properties loadFrom​(java.io.InputStream aInputStream,
                                   char... aDelimiters)
                            throws java.io.IOException,
                                   java.text.ParseException
        Loads the properties from the given InputStream. Save them using the method ResourceProperties.MutableResoureProperties.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.
        Specified by:
        loadFrom in interface ResourceProperties.MutableResoureProperties
        Parameters:
        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).
        Returns:
        The Properties as loaded from the resource and applied to this instance.
        Throws:
        java.io.IOException - thrown in case loading the properties failed
        java.text.ParseException - Signals that an error has been reached unexpectedly while parsing the data to be loaded.
      • saveTo

        public void saveTo​(java.io.OutputStream aOutputStream,
                           java.lang.String aComment,
                           char aDelimiter)
                    throws java.io.IOException
        The comment is ignored for the JSON format as JSON does not(!) support any comments! Saves the properties to the given OutputStream using the provided delimiter as the destination's path delimiter. Load them via ResourceProperties.MutableResoureProperties.loadFrom(InputStream, char...) This is the hook-method of the default implementation for writing (saving) 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.
        Specified by:
        saveTo in interface ResourceProperties.MutableResoureProperties
        Parameters:
        aOutputStream - The OutputStream to which to save the properties to.
        aComment - The description for the properties file.
        aDelimiter - The path delimiter to be used when writing out the properties to the destination (in case the the serialized format supports / requires the such).
        Throws:
        java.io.IOException - thrown in case saving the properties failed