Browse Source
This is a follow-up of gh-46599 where detecting the default value suffer from the same problem. Rather than using a name, the resolver now provides the field itself. This also adds a dedicated test for the use of @Name with Lombok. Closes gh-46662pull/46752/head
9 changed files with 156 additions and 30 deletions
22
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/ConstructorParameterNameAnnotationProperties.java → spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/name/ConstructorParameterNameAnnotationProperties.java
22
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/ConstructorParameterNameAnnotationProperties.java → spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/name/ConstructorParameterNameAnnotationProperties.java
20
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/JavaBeanNameAnnotationProperties.java → spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/name/JavaBeanNameAnnotationProperties.java
20
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/JavaBeanNameAnnotationProperties.java → spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/name/JavaBeanNameAnnotationProperties.java
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
/* |
||||
* Copyright 2012-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.configurationsample.name; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import org.springframework.boot.configurationsample.ConfigurationProperties; |
||||
import org.springframework.boot.configurationsample.Name; |
||||
|
||||
/** |
||||
* Lombok properties making use of {@code @Name}. |
||||
* |
||||
* @author Stephane Nicoll |
||||
*/ |
||||
@Getter |
||||
@Setter |
||||
@ConfigurationProperties("named") |
||||
public class LombokNameAnnotationProperties { |
||||
|
||||
/** |
||||
* Imports to apply. |
||||
*/ |
||||
@Name("import") |
||||
private String imports; |
||||
|
||||
/** |
||||
* Whether default mode is enabled. |
||||
*/ |
||||
@Name("default") |
||||
private boolean defaultValue = true; |
||||
|
||||
} |
||||
12
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/RecordComponentNameAnnotationProperties.java → spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/name/RecordComponentNameAnnotationProperties.java
12
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/RecordComponentNameAnnotationProperties.java → spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/name/RecordComponentNameAnnotationProperties.java
Loading…
Reference in new issue