类 SystemPropertyUtils
java.lang.Object
cn.taketoday.util.SystemPropertyUtils
Helper class for resolving placeholders in texts. Usually applied to file paths.
A text may contain ${...} placeholders, to be resolved as system properties:
e.g. ${user.dir}. Default values can be supplied using the ":" separator
between key and value.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Rob Harrop, Dave Syer, TODAY 2021/9/28 22:39
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明private static final recordPlaceholderResolver implementation that resolves against system properties and system environment variables. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringresolvePlaceholders(String text) Resolve${...}placeholders in the given text, replacing them with corresponding system property values.static StringresolvePlaceholders(String text, boolean ignoreUnresolvablePlaceholders) Resolve${...}placeholders in the given text, replacing them with corresponding system property values.
-
构造器详细资料
-
SystemPropertyUtils
public SystemPropertyUtils()
-
-
方法详细资料
-
resolvePlaceholders
Resolve${...}placeholders in the given text, replacing them with corresponding system property values.- 参数:
text- the String to resolve- 返回:
- the resolved String
- 抛出:
IllegalArgumentException- if there is an unresolvable placeholder- 另请参阅:
-
resolvePlaceholders
Resolve${...}placeholders in the given text, replacing them with corresponding system property values. Unresolvable placeholders with no default value are ignored and passed through unchanged if the flag is set totrue.- 参数:
text- the String to resolveignoreUnresolvablePlaceholders- whether unresolved placeholders are to be ignored- 返回:
- the resolved String
- 抛出:
IllegalArgumentException- if there is an unresolvable placeholder- 另请参阅:
-