Interface ResourcePropertiesMixin<B extends ResourcePropertiesMixin<B>>



  • public interface ResourcePropertiesMixin<B extends ResourcePropertiesMixin<B>>
    This mixin provides builder additions (as of the builder pattern for chained configuring method calls) for "dynamic" ResourceProperties: As ResourceProperties are immutable from an interface's point of view, there are no mutating methods provided. Sub-types of the ResourceProperties might need to load the properties after instantiation. Such types might implement this interface, providing means to load from resources after instantiation.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default B withFile​(java.io.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 ConfigLocator.getFolders().
      default B withFile​(java.io.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 ConfigLocator.getFolders().
      default B withFile​(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator)
      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 ConfigLocator.getFolders().
      B withFile​(java.io.File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator, 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 ConfigLocator.getFolders().
      default B withFilePath​(java.lang.Class<?> aResourceClass, java.lang.String aFilePath)
      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 ConfigLocator.getFolders().
      default B withFilePath​(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, 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 ConfigLocator.getFolders().
      B withFilePath​(java.lang.Class<?> aResourceClass, java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, 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 ConfigLocator.getFolders().
      default B withFilePath​(java.lang.String aFilePath)
      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 ConfigLocator.getFolders().
      default B withFilePath​(java.lang.String aFilePath, 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 ConfigLocator.getFolders().
      default B withFilePath​(java.lang.String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, 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 ConfigLocator.getFolders().
      default B withInputStream​(java.io.InputStream aInputStream)
      Reads the properties from the given InputStream.
      B withInputStream​(java.io.InputStream aInputStream, char... aDelimiters)
      Reads the properties from the given InputStream.
      default B withUrl​(java.net.URL aUrl)
      Loads the properties from the given URL.
      B withUrl​(java.net.URL aUrl, char... aDelimiters)
      Loads the properties from the given URL.
    • Method Detail

      • withFile

        default B withFile​(java.io.File aFile)
                    throws java.io.IOException,
                           java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aFile - The file of the properties to load.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withFile

        default B withFile​(java.io.File aFile,
                           org.refcodes.runtime.ConfigLocator aConfigLocator)
                    throws java.io.IOException,
                           java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aFile - The file of the properties to load.
        aConfigLocator - The ConfigLocator specifying where to seek for properties.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withFile

        default B withFile​(java.io.File aFile,
                           char... aDelimiters)
                    throws java.io.IOException,
                           java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aFile - The file of the properties to load.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withFile

        B withFile​(java.io.File aFile,
                   org.refcodes.runtime.ConfigLocator aConfigLocator,
                   char... aDelimiters)
            throws java.io.IOException,
                   java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aFile - The file of the properties to load.
        aConfigLocator - The ConfigLocator specifying where to seek for properties.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withInputStream

        default B withInputStream​(java.io.InputStream aInputStream)
                           throws java.io.IOException,
                                  java.text.ParseException
        Reads the properties from the given InputStream.
        Parameters:
        aInputStream - The InputStream from which to read the properties.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withInputStream

        B withInputStream​(java.io.InputStream aInputStream,
                          char... aDelimiters)
                   throws java.io.IOException,
                          java.text.ParseException
        Reads the properties from the given InputStream.
        Parameters:
        aInputStream - The InputStream from which to read the properties.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withFilePath

        default B withFilePath​(java.lang.String aFilePath)
                        throws java.io.IOException,
                               java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aFilePath - The file of the properties file to load.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withFilePath

        default B withFilePath​(java.lang.String aFilePath,
                               char... aDelimiters)
                        throws java.io.IOException,
                               java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aFilePath - The file of the properties file to load.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withFilePath

        default B withFilePath​(java.lang.Class<?> aResourceClass,
                               java.lang.String aFilePath)
                        throws java.io.IOException,
                               java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aResourceClass - The class which's class loader is to take care of loading the properties (from inside a JAR).
        aFilePath - The file of the properties file to load.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withFilePath

        default B withFilePath​(java.lang.Class<?> aResourceClass,
                               java.lang.String aFilePath,
                               char... aDelimiters)
                        throws java.io.IOException,
                               java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aResourceClass - The class which's class loader is to take care of loading the properties (from inside a JAR).
        aFilePath - The file of the properties file to load.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withFilePath

        default B withFilePath​(java.lang.String aFilePath,
                               org.refcodes.runtime.ConfigLocator aConfigLocator,
                               char... aDelimiters)
                        throws java.io.IOException,
                               java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aFilePath - The file of the properties file to load.
        aConfigLocator - The ConfigLocator specifying where to seek for properties.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withFilePath

        B withFilePath​(java.lang.Class<?> aResourceClass,
                       java.lang.String aFilePath,
                       org.refcodes.runtime.ConfigLocator aConfigLocator,
                       char... aDelimiters)
                throws java.io.IOException,
                       java.text.ParseException
        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 ConfigLocator.getFolders().
        Parameters:
        aResourceClass - The class which's class loader is to take care of loading the properties (from inside a JAR).
        aFilePath - The file of the properties file to load.
        aConfigLocator - The ConfigLocator specifying where to seek for properties.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withUrl

        default B withUrl​(java.net.URL aUrl)
                   throws java.io.IOException,
                          java.text.ParseException
        Loads the properties from the given URL.
        Parameters:
        aUrl - The URL from which to read the properties.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.
      • withUrl

        B withUrl​(java.net.URL aUrl,
                  char... aDelimiters)
           throws java.io.IOException,
                  java.text.ParseException
        Loads the properties from the given URL.
        Parameters:
        aUrl - The URL from which to read the properties.
        aDelimiters - The delimiters in the properties file to identity a path delimiter.
        Returns:
        This instance as of the builder pattern for chained method calls.
        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.