Class ConfigTreePropertySourceImporter
java.lang.Object
io.micronaut.context.env.ConfigTreePropertySourceImporter
- All Implemented Interfaces:
PropertySourceImporter<ConfigTreePropertySourceImporter.ConfigTreeImport>, Toggleable, AutoCloseable
public final class ConfigTreePropertySourceImporter
extends Object
implements PropertySourceImporter<ConfigTreePropertySourceImporter.ConfigTreeImport>
Imports key/value configuration from a config tree directory.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordTyped config tree import declaration.Nested classes/interfaces inherited from interface PropertySourceImporter
PropertySourceImporter.ImportContext<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionimportPropertySource(PropertySourceImporter.ImportContext<ConfigTreePropertySourceImporter.ConfigTreeImport> 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
-
ConfigTreePropertySourceImporter
public ConfigTreePropertySourceImporter()
-
-
Method Details
-
getProvider
- Specified by:
getProviderin interfacePropertySourceImporter<ConfigTreePropertySourceImporter.ConfigTreeImport>- Returns:
- The provider this importer supports.
-
newImportDeclaration
public ConfigTreePropertySourceImporter.ConfigTreeImport 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<ConfigTreePropertySourceImporter.ConfigTreeImport>- Parameters:
connectionString- The parsed connection string declaration- Returns:
- The typed import declaration
-
newImportDeclaration
public ConfigTreePropertySourceImporter.ConfigTreeImport newImportDeclaration(ConvertibleValues<Object> values) 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<ConfigTreePropertySourceImporter.ConfigTreeImport>- Parameters:
values- The structured config import values- Returns:
- The typed import declaration
-
importPropertySource
public Optional<PropertySource> importPropertySource(PropertySourceImporter.ImportContext<ConfigTreePropertySourceImporter.ConfigTreeImport> context) Description copied from interface:PropertySourceImporterResolve a property source from the provided context.- Specified by:
importPropertySourcein interfacePropertySourceImporter<ConfigTreePropertySourceImporter.ConfigTreeImport>- Parameters:
context- The import context- Returns:
- The imported property source
-