Interface ResourceProperties

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  ResourceProperties.MutableResoureProperties
      The interface ResourceProperties.MutableResoureProperties defines "dirty" methods allowing to modify ("mutate") the ResourceProperties.
      static interface  ResourceProperties.ResourcePropertiesBuilder
      The interface ResourceProperties.ResourcePropertiesBuilder defines builder functionality on top of the ResourceProperties.MutableResoureProperties.
      • 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.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>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] VALUE_ATTRIBUTES
      The names specified in this array denote a key which's value is to be used for the parent's path's value when parsing a configuration file.
    • Field Detail

      • VALUE_ATTRIBUTES

        static final java.lang.String[] VALUE_ATTRIBUTES
        The names specified in this array denote a key which's value is to be used for the parent's path's value when parsing a configuration file. E.g. "yaml" files cannot have a value for a node which has sub-nodes, same applies to "json" and "xml" makes using the "mixed content" mechanism hard. Therefore when we require a value for a node (path) which may have sub-nodes (sub-paths), then e.g. a "this" node assigns a value to it's enclosing parent node.
    • Method Detail

      • reload

        Properties reload()
                   throws java.io.IOException,
                          java.lang.IllegalStateException,
                          java.text.ParseException
        Reloads the ResourceProperties from the resource to which the ResourceProperties are attached to (such as a File as of ResourceProperties.MutableResoureProperties.loadFrom(File) or ResourceProperties.MutableResoureProperties.saveTo(File)). In case the resource (such as an InputStream) does not support reloading, then an IllegalStateException is thrown. Properties existing in the attached resource as well in the Properties itself are replaced. Properties existing in the attached resource but not(!) in the Properties itself are not(!) removed. Use reload(ReloadMode) with an argument of true (~ orphan removal) to remove properties not existing in the resource.
        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

        Properties reload​(ReloadMode aReloadMode)
                   throws java.io.IOException,
                          java.lang.IllegalStateException,
                          java.text.ParseException
        Reloads the ResourceProperties from the resource to which the ResourceProperties are attached to (such as a File as of ResourceProperties.MutableResoureProperties.loadFrom(File) or ResourceProperties.MutableResoureProperties.saveTo(File)). In case the resource (such as an InputStream) does not support reloading, then an IllegalStateException is thrown. Properties existing in the attached resource as well in the Properties itself are replaced. When "orphan removal" is set to false, then properties existing in the attached resource but not(!) in the Properties itself are not(!) removed. When "orphan removal" is set to true, then properties existing in the attached resource but not(!) in the Properties itself are(!) removed.
        Parameters:
        aReloadMode - when set to ReloadMode.ORPHAN_REMOVAL, then properties existing in the attached resource but not(!) in the Properties 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.