|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.util.SystemPropertyUtils
public abstract class 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.
PLACEHOLDER_PREFIX
,
PLACEHOLDER_SUFFIX
,
System.getProperty(String)
Nested Class Summary | |
---|---|
private static class |
SystemPropertyUtils.SystemPropertyPlaceholderResolver
|
Field Summary | |
---|---|
private static PropertyPlaceholderHelper |
nonStrictHelper
|
static java.lang.String |
PLACEHOLDER_PREFIX
Prefix for system property placeholders: "${" |
static java.lang.String |
PLACEHOLDER_SUFFIX
Suffix for system property placeholders: "}" |
private static PropertyPlaceholderHelper |
strictHelper
|
static java.lang.String |
VALUE_SEPARATOR
Value separator for system property placeholders: ":" |
Constructor Summary | |
---|---|
SystemPropertyUtils()
|
Method Summary | |
---|---|
static java.lang.String |
resolvePlaceholders(java.lang.String text)
Resolve ${...} placeholders in the given text, replacing them with corresponding system property values. |
static java.lang.String |
resolvePlaceholders(java.lang.String text,
boolean ignoreUnresolvablePlaceholders)
Resolve ${...} placeholders in the given text, replacing them with corresponding system property values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PLACEHOLDER_PREFIX
public static final java.lang.String PLACEHOLDER_SUFFIX
public static final java.lang.String VALUE_SEPARATOR
private static final PropertyPlaceholderHelper strictHelper
private static final PropertyPlaceholderHelper nonStrictHelper
Constructor Detail |
---|
public SystemPropertyUtils()
Method Detail |
---|
public static java.lang.String resolvePlaceholders(java.lang.String text)
text
- the String to resolve
java.lang.IllegalArgumentException
- if there is an unresolvable placeholderPLACEHOLDER_PREFIX
,
PLACEHOLDER_SUFFIX
public static java.lang.String resolvePlaceholders(java.lang.String text, boolean ignoreUnresolvablePlaceholders)
text
- the String to resolveignoreUnresolvablePlaceholders
- flag to determine is unresolved placeholders are ignored
java.lang.IllegalArgumentException
- if there is an unresolvable placeholder and the flag is falsePLACEHOLDER_PREFIX
,
PLACEHOLDER_SUFFIX
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |