Class FilePropertySourceImporter
java.lang.Object
io.micronaut.context.env.FilePropertySourceImporter
- All Implemented Interfaces:
PropertySourceImporter<FilePropertySourceImporter.FileImport>, Toggleable, AutoCloseable
public final class FilePropertySourceImporter
extends Object
implements PropertySourceImporter<FilePropertySourceImporter.FileImport>
Imports property sources from file system locations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordTyped file import declaration.Nested classes/interfaces inherited from interface PropertySourceImporter
PropertySourceImporter.ImportContext<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionimportPropertySource(PropertySourceImporter.ImportContext<FilePropertySourceImporter.FileImport> context) Resolve a property source from the provided context.newImportDeclaration(ConvertibleValues<Object> values) Convert structured config import values into a type-safe import declaration consumed by this importer.newImportDeclaration(ConnectionString connectionString) Convert the raw connection string into a type-safe import declaration consumed by this importer.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PropertySourceImporter
closeMethods inherited from interface Toggleable
isEnabled
-
Constructor Details
-
FilePropertySourceImporter
public FilePropertySourceImporter()
-
-
Method Details
-
getProvider
- Specified by:
getProviderin interfacePropertySourceImporter<FilePropertySourceImporter.FileImport>- Returns:
- The provider this importer supports.
-
newImportDeclaration
public FilePropertySourceImporter.FileImport newImportDeclaration(ConnectionString connectionString) Description copied from interface:PropertySourceImporterConvert the raw connection string into a type-safe import declaration consumed by this importer.Micronaut invokes this method once for each scalar
micronaut.config.importentry before callingPropertySourceImporter.importPropertySource(ImportContext). Implementations should validate any importer-specific semantics here and return an immutable declaration value suitable for repeated reads within the same load cycle.- Specified by:
newImportDeclarationin interfacePropertySourceImporter<FilePropertySourceImporter.FileImport>- Parameters:
connectionString- The parsed connection string declaration- Returns:
- The typed import declaration
-
newImportDeclaration
Description copied from interface:PropertySourceImporterConvert structured config import values into a type-safe import declaration consumed by this importer.Micronaut invokes this method for map-based
micronaut.config.importdeclarations after resolving the requiredproviderfield. Implementations should validate required keys and throw a configuration exception if the declaration is invalid.- Specified by:
newImportDeclarationin interfacePropertySourceImporter<FilePropertySourceImporter.FileImport>- Parameters:
values- The structured config import values- Returns:
- The typed import declaration
-
importPropertySource
public Optional<PropertySource> importPropertySource(PropertySourceImporter.ImportContext<FilePropertySourceImporter.FileImport> context) Description copied from interface:PropertySourceImporterResolve a property source from the provided context.- Specified by:
importPropertySourcein interfacePropertySourceImporter<FilePropertySourceImporter.FileImport>- Parameters:
context- The import context- Returns:
- The imported property source
-