Module org.refcodes.properties
Package org.refcodes.properties
Interface ResourceLoaderBuilder<B extends ResourceLoaderBuilder<B>>
public interface ResourceLoaderBuilder<B extends ResourceLoaderBuilder<B>>
This interface 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
Modifier and TypeMethodDescriptiondefault B
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 methodConfigLocator.getFolders()
.default B
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 methodConfigLocator.getFolders()
.default B
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 methodConfigLocator.getFolders()
.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 methodConfigLocator.getFolders()
.default B
withInputStream
(InputStream aInputStream) Reads the properties from the givenInputStream
.withInputStream
(InputStream aInputStream, char... aDelimiters) Reads the properties from the givenInputStream
.default B
withResourceClass
(Class<?> aResourceClass, 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 methodConfigLocator.getFolders()
.default B
withResourceClass
(Class<?> aResourceClass, 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 methodConfigLocator.getFolders()
.withResourceClass
(Class<?> aResourceClass, 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 methodConfigLocator.getFolders()
.default B
withResourceClass
(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 methodConfigLocator.getFolders()
.default B
withResourceClass
(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 methodConfigLocator.getFolders()
.default B
withResourceClass
(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 methodConfigLocator.getFolders()
.default B
Loads the properties from the givenURL
.Loads the properties from the givenURL
.
-
Method Details
-
withFile
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 methodConfigLocator.getFolders()
.- Parameters:
aFile
- The file of the properties to load.- Returns:
- This instance as of the builder pattern for chained method calls.
- Throws:
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.
-
withFile
default B withFile(File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator) throws IOException, 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 methodConfigLocator.getFolders()
.- Parameters:
aFile
- The file of the properties to load.aConfigLocator
- TheConfigLocator
specifying where to seek for properties.- Returns:
- This instance as of the builder pattern for chained method calls.
- Throws:
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.
-
withFile
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 methodConfigLocator.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:
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.
-
withFile
B withFile(File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) throws IOException, 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 methodConfigLocator.getFolders()
.- Parameters:
aFile
- The file of the properties to load.aConfigLocator
- TheConfigLocator
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:
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.
-
withInputStream
Reads the properties from the givenInputStream
.- Parameters:
aInputStream
- TheInputStream
from which to read the properties.- Returns:
- This instance as of the builder pattern for chained method calls.
- Throws:
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.
-
withInputStream
Reads the properties from the givenInputStream
.- Parameters:
aInputStream
- TheInputStream
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:
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.
-
withResourceClass
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 methodConfigLocator.getFolders()
.- Parameters:
aFilePath
- The file of the properties file to load.- Returns:
- This instance as of the builder pattern for chained method calls.
- Throws:
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.
-
withResourceClass
default B withResourceClass(String aFilePath, char... aDelimiters) throws IOException, 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 methodConfigLocator.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:
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.
-
withResourceClass
default B withResourceClass(Class<?> aResourceClass, String aFilePath) throws IOException, 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 methodConfigLocator.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:
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.
-
withResourceClass
default B withResourceClass(Class<?> aResourceClass, String aFilePath, char... aDelimiters) throws IOException, 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 methodConfigLocator.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:
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.
-
withResourceClass
default B withResourceClass(String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) throws IOException, 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 methodConfigLocator.getFolders()
.- Parameters:
aFilePath
- The file of the properties file to load.aConfigLocator
- TheConfigLocator
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:
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.
-
withResourceClass
B withResourceClass(Class<?> aResourceClass, String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) throws IOException, 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 methodConfigLocator.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
- TheConfigLocator
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:
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.
-
withUrl
Loads the properties from the givenURL
.- Parameters:
aUrl
- TheURL
from which to read the properties.- Returns:
- This instance as of the builder pattern for chained method calls.
- Throws:
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.
-
withUrl
Loads the properties from the givenURL
.- Parameters:
aUrl
- TheURL
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:
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.
-