Refactor @ConfigurationProperties that only use prefix

See gh-43917

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
This commit is contained in:
Yanming Zhou
2025-01-22 10:14:53 +08:00
committed by Phillip Webb
parent 7bcdb7d3ee
commit c1d97ffe16
173 changed files with 237 additions and 237 deletions

View File

@@ -22,7 +22,7 @@ import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "my.messaging")
@ConfigurationProperties("my.messaging")
public class MyMessagingProperties {
private List<String> addresses = new ArrayList<>(Arrays.asList("a", "b"));

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.docs.appendix.configurationmetadata.annotationp
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "my.server")
@ConfigurationProperties("my.server")
public class MyServerProperties {
/**

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.docs.appendix.configurationmetadata.annotationp
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "my.server")
@ConfigurationProperties("my.server")
public class MyServerProperties {
private String name;

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "my.main-project.person")
@ConfigurationProperties("my.main-project.person")
public class MyPersonProperties {
private String firstName;

View File

@@ -21,7 +21,7 @@ import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "my.props")
@ConfigurationProperties("my.props")
public class MyMapsProperties {
private final Map<String, String> values = new HashMap<>();

View File

@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration;
public class ThirdPartyConfiguration {
@Bean
@ConfigurationProperties(prefix = "another")
@ConfigurationProperties("another")
public AnotherComponent anotherComponent() {
return new AnotherComponent();
}

View File

@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration;
public class MyDataSourceConfiguration {
@Bean
@ConfigurationProperties(prefix = "app.datasource")
@ConfigurationProperties("app.datasource")
public SomeDataSource dataSource() {
return new SomeDataSource();
}

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.docs.packaging.nativeimage.advanced.nestedconfi
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
@ConfigurationProperties(prefix = "my.properties")
@ConfigurationProperties("my.properties")
public class MyProperties {
private String name;

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.docs.packaging.nativeimage.advanced.nestedconfi
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
@ConfigurationProperties(prefix = "my.properties")
@ConfigurationProperties("my.properties")
public class MyPropertiesCtor {
private final String name;

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.docs.packaging.nativeimage.advanced.nestedconfi
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
@ConfigurationProperties(prefix = "my.properties")
@ConfigurationProperties("my.properties")
public record MyPropertiesRecord(String name, @NestedConfigurationProperty Nested nested) {
}

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.docs.configurationmetadata.annotationprocessor.
import org.springframework.boot.context.properties.ConfigurationProperties
import java.util.Arrays
@ConfigurationProperties(prefix = "my.messaging")
@ConfigurationProperties("my.messaging")
class MyMessagingProperties(
val addresses: List<String> = ArrayList(Arrays.asList("a", "b")),

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.docs.configurationmetadata.annotationprocessor.
import org.springframework.boot.context.properties.ConfigurationProperties
@ConfigurationProperties(prefix = "my.server")
@ConfigurationProperties("my.server")
class MyServerProperties(
/**

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.docs.configurationmetadata.annotationprocessor.
import org.springframework.boot.context.properties.ConfigurationProperties
@ConfigurationProperties(prefix = "my.server")
@ConfigurationProperties("my.server")
class MyServerProperties(
var name: String,
var host: Host) {

View File

@@ -18,7 +18,7 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat
import org.springframework.boot.context.properties.ConfigurationProperties
@ConfigurationProperties(prefix = "my.main-project.person")
@ConfigurationProperties("my.main-project.person")
class MyPersonProperties {
var firstName: String? = null

View File

@@ -2,7 +2,7 @@ package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat
import org.springframework.boot.context.properties.ConfigurationProperties
@ConfigurationProperties(prefix = "my.props")
@ConfigurationProperties("my.props")
class MyMapsProperties {
val values: Map<String, String> = HashMap()

View File

@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration
class ThirdPartyConfiguration {
@Bean
@ConfigurationProperties(prefix = "another")
@ConfigurationProperties("another")
fun anotherComponent(): AnotherComponent = AnotherComponent()
}

View File

@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration
class MyDataSourceConfiguration {
@Bean
@ConfigurationProperties(prefix = "app.datasource")
@ConfigurationProperties("app.datasource")
fun dataSource(): SomeDataSource {
return SomeDataSource()
}

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.docs.packaging.nativeimage.advanced.nestedconfi
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.NestedConfigurationProperty
@ConfigurationProperties(prefix = "my.properties")
@ConfigurationProperties("my.properties")
data class MyPropertiesKotlin(
val name: String,
@NestedConfigurationProperty val nested: Nested