Skip to content

Commit 75f4739

Browse files
committed
Polishing
1 parent 11b4e3b commit 75f4739

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -61,8 +61,8 @@
6161
* a {@code PropertySourcesPlaceholderConfigurer}. This happens automatically when using
6262
* {@code <context:property-placeholder>} in XML, but must be explicitly registered using
6363
* a {@code static} {@code @Bean} method when using {@code @Configuration} classes. See
64-
* the "Working with externalized values" section of @{@link Configuration} Javadoc and
65-
* "a note on BeanFactoryPostProcessor-returning @Bean methods" of @{@link Bean} Javadoc
64+
* the "Working with externalized values" section of @{@link Configuration}'s javadoc and
65+
* "a note on BeanFactoryPostProcessor-returning @Bean methods" of @{@link Bean}'s javadoc
6666
* for details and examples.
6767
*
6868
* <h3>Resolving ${...} placeholders within {@code @PropertySource} resource locations</h3>
@@ -126,11 +126,11 @@
126126
* <p>In certain situations, it may not be possible or practical to tightly control
127127
* property source ordering when using {@code @ProperySource} annotations. For example,
128128
* if the {@code @Configuration} classes above were registered via component-scanning,
129-
* the ordering is difficult to predict. In such cases - and if overriding is important -
129+
* the ordering is difficult to predict. In such cases - and if overriding is important -
130130
* it is recommended that the user fall back to using the programmatic PropertySource API.
131131
* See {@link org.springframework.core.env.ConfigurableEnvironment ConfigurableEnvironment}
132132
* and {@link org.springframework.core.env.MutablePropertySources MutablePropertySources}
133-
* Javadoc for details.
133+
* javadocs for details.
134134
*
135135
* @author Chris Beams
136136
* @author Phillip Webb
@@ -160,11 +160,11 @@
160160
* Indicate the resource location(s) of the properties file to be loaded.
161161
* For example, {@code "classpath:/com/myco/app.properties"} or
162162
* {@code "file:/path/to/file"}.
163-
* <p>Resource location wildcards (e.g. *&#42;/*.properties) are not permitted; each
164-
* location must evaluate to exactly one {@code .properties} resource.
163+
* <p>Resource location wildcards (e.g. *&#42;/*.properties) are not permitted;
164+
* each location must evaluate to exactly one {@code .properties} resource.
165165
* <p>${...} placeholders will be resolved against any/all property sources already
166-
* registered with the {@code Environment}. See {@linkplain PropertySource above} for
167-
* examples.
166+
* registered with the {@code Environment}. See {@linkplain PropertySource above}
167+
* for examples.
168168
* <p>Each location will be added to the enclosing {@code Environment} as its own
169169
* property source, and in the order declared.
170170
*/

spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -35,35 +35,32 @@
3535
import org.springframework.util.StringValueResolver;
3636

3737
/**
38-
* Specialization of {@link org.springframework.beans.factory.config.PlaceholderConfigurerSupport
39-
* PlaceholderConfigurerSupport} that resolves ${...} placeholders within bean definition
40-
* property values and {@code @Value} annotations against the current Spring {@link
41-
* Environment} and its set of {@link PropertySources}.
38+
* Specialization of {@link PlaceholderConfigurerSupport} that resolves ${...} placeholders
39+
* within bean definition property values and {@code @Value} annotations against the current
40+
* Spring {@link Environment} and its set of {@link PropertySources}.
4241
*
43-
* <p>This class is designed as a general replacement for {@code
44-
* PropertyPlaceholderConfigurer} in Spring 3.1 applications. It is used by default to
45-
* support the {@code property-placeholder} element in working against the
46-
* spring-context-3.1 XSD, whereas spring-context versions &lt;= 3.0 default to
47-
* {@code PropertyPlaceholderConfigurer} to ensure backward compatibility. See
48-
* spring-context XSD documentation for complete details.
42+
* <p>This class is designed as a general replacement for {@code PropertyPlaceholderConfigurer}
43+
* in Spring 3.1 applications. It is used by default to support the {@code property-placeholder}
44+
* element in working against the spring-context-3.1 XSD, whereas spring-context versions
45+
* &lt;= 3.0 default to {@code PropertyPlaceholderConfigurer} to ensure backward compatibility.
46+
* See the spring-context XSD documentation for complete details.
4947
*
50-
* <p>Any local properties (e.g. those added via {@link #setProperties},
51-
* {@link #setLocations} et al.) are added as a {@code PropertySource}. Search precedence
52-
* of local properties is based on the value of the {@link #setLocalOverride localOverride}
53-
* property, which is by default {@code false} meaning that local properties are to be
54-
* searched last, after all environment property sources.
48+
* <p>Any local properties (e.g. those added via {@link #setProperties}, {@link #setLocations}
49+
* et al.) are added as a {@code PropertySource}. Search precedence of local properties is
50+
* based on the value of the {@link #setLocalOverride localOverride} property, which is by
51+
* default {@code false} meaning that local properties are to be searched last, after all
52+
* environment property sources.
5553
*
5654
* <p>See {@link org.springframework.core.env.ConfigurableEnvironment ConfigurableEnvironment}
57-
* and related Javadoc for details on manipulating environment property sources.
55+
* and related javadocs for details on manipulating environment property sources.
5856
*
5957
* @author Chris Beams
6058
* @since 3.1
6159
* @see org.springframework.core.env.ConfigurableEnvironment
6260
* @see org.springframework.beans.factory.config.PlaceholderConfigurerSupport
6361
* @see org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
6462
*/
65-
public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerSupport
66-
implements EnvironmentAware {
63+
public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerSupport implements EnvironmentAware {
6764

6865
/**
6966
* {@value} is the name given to the {@link PropertySource} for the set of
@@ -139,7 +136,7 @@ public String getProperty(String key) {
139136
}
140137
try {
141138
PropertySource<?> localPropertySource =
142-
new PropertiesPropertySource(LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME, mergeProperties());
139+
new PropertiesPropertySource(LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME, mergeProperties());
143140
if (this.localOverride) {
144141
this.propertySources.addFirst(localPropertySource);
145142
}

0 commit comments

Comments
 (0)