java.lang.Object
org.springframework.core.env.PropertySource<String>
dev.orne.config.spring.ConfigLazyPropertySource
@API(status=INTERNAL,
since="1.0")
public class ConfigLazyPropertySource
extends org.springframework.core.env.PropertySource<String>
Spring
PropertySource that uses a Config bean lazily loaded
from the application context on first access.
Allows configuration of the property source during bean factory post processing, before the configuration bean is available.
- Since:
- 1.0
- Version:
- 1.0, 2025-08
- Author:
- (w) Iker Hernaez
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource
org.springframework.core.env.PropertySource.StubPropertySource -
Field Summary
Fields inherited from class org.springframework.core.env.PropertySource
logger, name, source -
Constructor Summary
ConstructorsConstructorDescriptionConfigLazyPropertySource(@NotNull String name, @NotNull org.springframework.beans.factory.BeanFactory beanFactory, @NotNull String beanName) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsProperty(@NotNull String name) booleanprotected @NotNull org.springframework.beans.factory.BeanFactoryReturns the bean factory.protected @NotNull ConfigGets the configuration instance.getProperty(@NotNull String name) inthashCode()Methods inherited from class org.springframework.core.env.PropertySource
getName, getSource, named, toString
-
Constructor Details
-
ConfigLazyPropertySource
public ConfigLazyPropertySource(@NotNull @NotNull String name, @NotNull @NotNull org.springframework.beans.factory.BeanFactory beanFactory, @NotNull @NotNull String beanName) Creates a new instance.- Parameters:
name- The name of the property source.beanFactory- The bean factory to load the configuration bean.beanName- The name of the configuration bean.
-
-
Method Details
-
containsProperty
- Overrides:
containsPropertyin classorg.springframework.core.env.PropertySource<String>
-
getProperty
- Specified by:
getPropertyin classorg.springframework.core.env.PropertySource<String>
-
getBeanFactory
@NotNull protected @NotNull org.springframework.beans.factory.BeanFactory getBeanFactory()Returns the bean factory.- Returns:
- The bean factory.
-
getConfig
Gets the configuration instance.The configuration instance is retrieved lazily from the bean factory using the bean name provided as source of this property source on first access.
- Returns:
- The configuration instance.
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.springframework.core.env.PropertySource<String>
-
equals
- Overrides:
equalsin classorg.springframework.core.env.PropertySource<String>
-