Skip to content

Commit e34cdc2

Browse files
committed
Improve Javadoc for property placeholder support
1 parent 8b1b9ef commit e34cdc2

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ public void setValueSeparator(@Nullable String valueSeparator) {
160160
}
161161

162162
/**
163-
* Specify the escape character to use to ignore the placeholder prefix or
164-
* value separator, or {@code null} if no escaping should take place.
165-
* <p>Default is {@link #DEFAULT_ESCAPE_CHARACTER}.
163+
* Set the escape character to use to ignore the
164+
* {@linkplain #setPlaceholderPrefix(String) placeholder prefix} and the
165+
* {@linkplain #setValueSeparator(String) value separator}, or {@code null}
166+
* if no escaping should take place.
166167
* @since 6.2
167168
*/
168169
public void setEscapeCharacter(@Nullable Character escapeCharacter) {

spring-core/src/main/java/org/springframework/core/env/AbstractPropertyResolver.java

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ public void setConversionService(ConfigurableConversionService conversionService
9191
}
9292

9393
/**
94-
* Set the prefix that placeholders replaced by this resolver must begin with.
95-
* <p>The default is "${".
96-
* @see org.springframework.util.SystemPropertyUtils#PLACEHOLDER_PREFIX
94+
* {@inheritDoc}
95+
* <p>The default is <code>"${"</code>.
96+
* @see SystemPropertyUtils#PLACEHOLDER_PREFIX
9797
*/
9898
@Override
9999
public void setPlaceholderPrefix(String placeholderPrefix) {
@@ -102,9 +102,9 @@ public void setPlaceholderPrefix(String placeholderPrefix) {
102102
}
103103

104104
/**
105-
* Set the suffix that placeholders replaced by this resolver must end with.
106-
* <p>The default is "}".
107-
* @see org.springframework.util.SystemPropertyUtils#PLACEHOLDER_SUFFIX
105+
* {@inheritDoc}
106+
* <p>The default is <code>"}"</code>.
107+
* @see SystemPropertyUtils#PLACEHOLDER_SUFFIX
108108
*/
109109
@Override
110110
public void setPlaceholderSuffix(String placeholderSuffix) {
@@ -113,24 +113,20 @@ public void setPlaceholderSuffix(String placeholderSuffix) {
113113
}
114114

115115
/**
116-
* Specify the separating character between the placeholders replaced by this
117-
* resolver and their associated default value, or {@code null} if no such
118-
* special character should be processed as a value separator.
119-
* <p>The default is ":".
120-
* @see org.springframework.util.SystemPropertyUtils#VALUE_SEPARATOR
116+
* {@inheritDoc}
117+
* <p>The default is {@code ":"}.
118+
* @see SystemPropertyUtils#VALUE_SEPARATOR
121119
*/
122120
@Override
123121
public void setValueSeparator(@Nullable String valueSeparator) {
124122
this.valueSeparator = valueSeparator;
125123
}
126124

127125
/**
128-
* Specify the escape character to use to ignore placeholder prefix
129-
* or value separator, or {@code null} if no escaping should take
130-
* place.
131-
* <p>The default is '\'.
126+
* {@inheritDoc}
127+
* <p>The default is {@code '\'}.
132128
* @since 6.2
133-
* @see org.springframework.util.SystemPropertyUtils#ESCAPE_CHARACTER
129+
* @see SystemPropertyUtils#ESCAPE_CHARACTER
134130
*/
135131
@Override
136132
public void setEscapeCharacter(@Nullable Character escapeCharacter) {

spring-core/src/main/java/org/springframework/util/SystemPropertyUtils.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 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,16 +35,19 @@
3535
*/
3636
public abstract class SystemPropertyUtils {
3737

38-
/** Prefix for system property placeholders: {@value}. */
38+
/** Prefix for property placeholders: {@value}. */
3939
public static final String PLACEHOLDER_PREFIX = "${";
4040

41-
/** Suffix for system property placeholders: {@value}. */
41+
/** Suffix for property placeholders: {@value}. */
4242
public static final String PLACEHOLDER_SUFFIX = "}";
4343

44-
/** Value separator for system property placeholders: {@value}. */
44+
/** Value separator for property placeholders: {@value}. */
4545
public static final String VALUE_SEPARATOR = ":";
4646

47-
/** Default escape character: {@code '\'}. */
47+
/**
48+
* Escape character for property placeholders: {@code '\'}.
49+
* @since 6.2
50+
*/
4851
public static final Character ESCAPE_CHARACTER = '\\';
4952

5053

0 commit comments

Comments
 (0)