|
49 | 49 | * {@link org.springframework.beans.factory.config.YamlPropertiesFactoryBean} that takes |
50 | 50 | * care to override profile-based collections and maps. |
51 | 51 | * |
52 | | - * Unlike YamlPropertiesFactoryBean, which flattens collections and maps, this one does things a bit different. |
| 52 | + * We can't use the same functionality of loading yaml files that spring-boot does : |
| 53 | + * {@link org.springframework.boot.env.YamlPropertySourceLoader} and thus OriginTrackedYamlLoader, |
| 54 | + * because spring-boot loads every single yaml document (all in a file) into a separate PropertySource. |
| 55 | + * So each yaml document ends up in a separate PropertySource. We, on the other hand, have to load all yaml documents |
| 56 | + * into a single Properties file, that ends up being a single PropertySource. |
| 57 | + * This happens because we first have to read configmaps / secrets |
| 58 | + * and only at that point do we know if a yaml contains more than one document. |
| 59 | + * |
| 60 | + * As such, we mimic the same things that spring-boot achieves by creating our own yaml reader, that is neavily based |
| 61 | + * on the YamlPropertiesFactoryBean. |
| 62 | + * |
| 63 | + * This is how it does things: |
53 | 64 | * |
54 | 65 | * <ul> |
55 | 66 | * <li>read all the documents in a yaml file</li> |
|
65 | 76 | * |
66 | 77 | * @author wind57 |
67 | 78 | */ |
68 | | -final class CustomYamlPropertiesFactoryBean { |
| 79 | +final class ProfileActivationAwareYamlPropertiesFactoryBean { |
69 | 80 |
|
70 | | - private static final LogAccessor LOG = new LogAccessor(LogFactory.getLog(CustomYamlPropertiesFactoryBean.class)); |
| 81 | + private static final LogAccessor LOG = new LogAccessor(LogFactory.getLog(ProfileActivationAwareYamlPropertiesFactoryBean.class)); |
71 | 82 |
|
72 | 83 | private List<DocumentMatcher> documentMatchers = Collections.emptyList(); |
73 | 84 |
|
|
0 commit comments