Merge branch '1.5.x' into 2.0.x
This commit is contained in:
commit
174cc2bc4e
|
@ -142,6 +142,7 @@ class TypeUtils {
|
||||||
String javadoc = (element != null
|
String javadoc = (element != null
|
||||||
? this.env.getElementUtils().getDocComment(element) : null);
|
? this.env.getElementUtils().getDocComment(element) : null);
|
||||||
if (javadoc != null) {
|
if (javadoc != null) {
|
||||||
|
javadoc = javadoc.replaceAll("\\n", "");
|
||||||
javadoc = javadoc.trim();
|
javadoc = javadoc.trim();
|
||||||
}
|
}
|
||||||
return ("".equals(javadoc) ? null : javadoc);
|
return ("".equals(javadoc) ? null : javadoc);
|
||||||
|
|
|
@ -64,6 +64,7 @@ import org.springframework.boot.configurationsample.method.MethodAndClassConfig;
|
||||||
import org.springframework.boot.configurationsample.method.SimpleMethodConfig;
|
import org.springframework.boot.configurationsample.method.SimpleMethodConfig;
|
||||||
import org.springframework.boot.configurationsample.simple.ClassWithNestedProperties;
|
import org.springframework.boot.configurationsample.simple.ClassWithNestedProperties;
|
||||||
import org.springframework.boot.configurationsample.simple.DeprecatedSingleProperty;
|
import org.springframework.boot.configurationsample.simple.DeprecatedSingleProperty;
|
||||||
|
import org.springframework.boot.configurationsample.simple.DescriptionProperties;
|
||||||
import org.springframework.boot.configurationsample.simple.HierarchicalProperties;
|
import org.springframework.boot.configurationsample.simple.HierarchicalProperties;
|
||||||
import org.springframework.boot.configurationsample.simple.NotAnnotated;
|
import org.springframework.boot.configurationsample.simple.NotAnnotated;
|
||||||
import org.springframework.boot.configurationsample.simple.SimpleArrayProperties;
|
import org.springframework.boot.configurationsample.simple.SimpleArrayProperties;
|
||||||
|
@ -210,6 +211,20 @@ public class ConfigurationMetadataAnnotationProcessorTests {
|
||||||
.fromSource(HierarchicalProperties.class));
|
.fromSource(HierarchicalProperties.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void descriptionProperties() {
|
||||||
|
ConfigurationMetadata metadata = compile(DescriptionProperties.class);
|
||||||
|
assertThat(metadata).has(Metadata.withGroup("description")
|
||||||
|
.fromSource(DescriptionProperties.class));
|
||||||
|
assertThat(metadata).has(Metadata.withProperty("description.simple", String.class)
|
||||||
|
.fromSource(DescriptionProperties.class)
|
||||||
|
.withDescription("A simple description."));
|
||||||
|
assertThat(metadata).has(Metadata
|
||||||
|
.withProperty("description.multi-line", String.class)
|
||||||
|
.fromSource(DescriptionProperties.class).withDescription(
|
||||||
|
"This is a lengthy description that spans across multiple lines to showcase that the carriage return is cleaned automatically."));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void deprecatedProperties() {
|
public void deprecatedProperties() {
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2012-2018 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
|
||||||
|
*
|
||||||
|
* http://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.simple;
|
||||||
|
|
||||||
|
import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration properties with various description styles.
|
||||||
|
*
|
||||||
|
* @author Stephane Nicoll
|
||||||
|
*/
|
||||||
|
@ConfigurationProperties("description")
|
||||||
|
public class DescriptionProperties {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple description.
|
||||||
|
*/
|
||||||
|
private String simple;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a lengthy description that spans across multiple lines to showcase that the
|
||||||
|
* carriage return is cleaned automatically.
|
||||||
|
*/
|
||||||
|
private String multiLine;
|
||||||
|
|
||||||
|
public String getSimple() {
|
||||||
|
return this.simple;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSimple(String simple) {
|
||||||
|
this.simple = simple;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMultiLine() {
|
||||||
|
return this.multiLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMultiLine(String multiLine) {
|
||||||
|
this.multiLine = multiLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue