Skip to content

Commit 49a4ed2

Browse files
committed
Improve Javadoc for @propertysource
1 parent 717d03a commit 49a4ed2

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -106,7 +106,7 @@
106106
*
107107
* <h3>A note on property overriding with {@code @PropertySource}</h3>
108108
*
109-
* <p>In cases where a given property key exists in more than one {@code .properties}
109+
* <p>In cases where a given property key exists in more than one property resource
110110
* file, the last {@code @PropertySource} annotation processed will 'win' and override
111111
* any previous key with the same name.
112112
*
@@ -182,14 +182,13 @@
182182
String name() default "";
183183

184184
/**
185-
* Indicate the resource location(s) of the properties file to be loaded.
186-
* <p>Both traditional and XML-based properties file formats are supported
187-
* &mdash; for example, {@code "classpath:/com/myco/app.properties"}
188-
* or {@code "file:/path/to/file.xml"}.
185+
* Indicate the resource locations of the properties files to be loaded.
186+
* <p>The default {@link #factory() factory} supports both traditional and
187+
* XML-based properties file formats &mdash; for example,
188+
* {@code "classpath:/com/myco/app.properties"} or {@code "file:/path/to/file.xml"}.
189189
* <p>Resource location wildcards (e.g. *&#42;/*.properties) are not permitted;
190-
* each location must evaluate to exactly one {@code .properties} or {@code .xml}
191-
* resource.
192-
* <p>${...} placeholders will be resolved against any/all property sources already
190+
* each location must evaluate to exactly one resource.
191+
* <p>${...} placeholders will be resolved against property sources already
193192
* registered with the {@code Environment}. See {@linkplain PropertySource above}
194193
* for examples.
195194
* <p>Each location will be added to the enclosing {@code Environment} as its own
@@ -214,7 +213,9 @@
214213

215214
/**
216215
* Specify a custom {@link PropertySourceFactory}, if any.
217-
* <p>By default, a default factory for standard resource files will be used.
216+
* <p>By default, a default factory for standard resource files will be used
217+
* which supports {@code *.properties} and {@code *.xml} file formats for
218+
* {@link java.util.Properties}.
218219
* @since 4.3
219220
* @see org.springframework.core.io.support.DefaultPropertySourceFactory
220221
* @see org.springframework.core.io.support.ResourcePropertySource

0 commit comments

Comments
 (0)