- All Known Implementing Classes:
KeyValuesLoader.Builder
public interface KeyValuesLoader
Represents a loader responsible for loading
KeyValues
from configured sources.
This interface defines the contract for loading key-value pairs, potentially involving
interpolation or resource chaining.
Implementations of this interface may load key-values from various sources such as files, classpath resources, or system properties.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder class for constructing instances ofKeyValuesLoader
. -
Method Summary
-
Method Details
-
load
KeyValues load() throws IOException, FileNotFoundException, NoSuchFileException, KeyValuesException, UncheckedIOExceptionLoads key-values from configured sources.- Returns:
- a
KeyValues
instance containing the loaded key-value pairs - Throws:
IOException
- if an I/O error occurs during loadingFileNotFoundException
- if a specified resource is not found (old io)NoSuchFileException
- if a specified resource is not found (nio)KeyValuesException
- if an error occurs while processing keys such as interpolation or invalid resource keys.UncheckedIOException
- if an IO error happens that had to be wrapped. Some loaders may throw an unchecked IO because of the difficulty of checked exceptions. The KeyValues system will unwrap the exception and check if it is one of the previous missing resource exceptions.
-