You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Polish the prefix support introduced in commit a8592f3 and fix a
package tangle between `boot.context.properties.source` and `boot.env`.
The `Prefix` interface has now been moved into a new default method on
`OriginLookup`.
See gh-3450
Spring Boot supports setting a prefix for environment properties.
1019
1021
This is useful if the system environment is shared by multiple Spring Boot applications with different configuration requirements.
1020
1022
The prefix for system environment properties can be set directly on `SpringApplication`.
1021
1023
1022
-
For example, if you set the prefix to `input`, a property such as `foo.bar` will also be resolved as `input.foo.bar` in the system environment.
1024
+
For example, if you set the prefix to `input`, a property such as `remote.timeout` will also be resolved as `input.remote.timeout` in the system environment.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java
+56-9
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2020 the original author or authors.
2
+
* Copyright 2012-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
24
24
importjava.util.function.Function;
25
25
26
26
importorg.springframework.util.Assert;
27
+
importorg.springframework.util.StringUtils;
27
28
28
29
/**
29
30
* A configuration property name composed of elements separated by dots. User created
@@ -195,19 +196,32 @@ public int getNumberOfElements() {
195
196
}
196
197
197
198
/**
198
-
* Create a new {@link ConfigurationPropertyName} by appending the given elements.
199
-
* @param elements the elements to append
199
+
* Create a new {@link ConfigurationPropertyName} by appending the given suffix.
200
+
* @param suffix the elements to append
200
201
* @return a new {@link ConfigurationPropertyName}
201
202
* @throws InvalidConfigurationPropertyNameException if the result is not valid
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySource.java
+4-2
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2020 the original author or authors.
2
+
* Copyright 2012-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/IterableConfigurationPropertySource.java
+3-2
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2019 the original author or authors.
2
+
* Copyright 2012-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PrefixedConfigurationPropertySource.java
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PrefixedIterableConfigurationPropertySource.java
+5-13
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,6 @@
18
18
19
19
importjava.util.stream.Stream;
20
20
21
-
importorg.springframework.util.StringUtils;
22
-
23
21
/**
24
22
* An iterable {@link PrefixedConfigurationPropertySource}.
25
23
*
@@ -34,17 +32,11 @@ class PrefixedIterableConfigurationPropertySource extends PrefixedConfigurationP
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySources.java
+4-4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2020 the original author or authors.
2
+
* Copyright 2012-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
0 commit comments