${name}. Using PropertyPlaceholderHelper
these placeholders can be substituted for user-supplied values.
Values for substitution can be supplied using a Properties instance or
using a PlaceholderResolver.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | PropertyPlaceholderHelper.
Strategy interface used to resolve replacement values for placeholders contained in Strings. |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private static final Log | |
| private final String | |
| private final String | |
| private final String | |
| private final String | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| public | PropertyPlaceholderHelper(String
the prefix that denotes the start of a placeholder placeholderPrefix, String the suffix that denotes the end of a placeholder placeholderSuffix)Creates a new |
| public | PropertyPlaceholderHelper(String
the prefix that denotes the start of a placeholder placeholderPrefix, String the suffix that denotes the end of a placeholder placeholderSuffix, String the separating character between the placeholder variable
and the associated default value, if any valueSeparator, boolean indicates whether unresolvable placeholders should
be ignored ( ignoreUnresolvablePlaceholders)true) or cause an exception (false)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| protected String | parseStringValue(String value, PropertyPlaceholderHelper.
|
| public String | Returns: the supplied value with placeholders replaced inlinethe value containing the placeholders to be replaced value, final Properties the properties)Properties to use for replacementReplaces all placeholders of format |
| public String | Returns: the supplied value with placeholders replaced inlinethe value containing the placeholders to be replaced value, PropertyPlaceholderHelper.the placeholderResolverPlaceholderResolver to use for replacementReplaces all placeholders of format |
| ignoreUnresolvablePlaceholders | back to summary |
|---|---|
| private final boolean ignoreUnresolvablePlaceholders | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| placeholderPrefix | back to summary |
|---|---|
| private final String placeholderPrefix | |
| placeholderSuffix | back to summary |
|---|---|
| private final String placeholderSuffix | |
| simplePrefix | back to summary |
|---|---|
| private final String simplePrefix | |
| valueSeparator | back to summary |
|---|---|
| private final String valueSeparator
| |
| wellKnownSimplePrefixes | back to summary |
|---|---|
| private static final Map<String, String> wellKnownSimplePrefixes | |
| PropertyPlaceholderHelper | back to summary |
|---|---|
| public PropertyPlaceholderHelper(String placeholderPrefix, String placeholderSuffix) Creates a new | |
| PropertyPlaceholderHelper | back to summary |
|---|---|
| public PropertyPlaceholderHelper(String placeholderPrefix, String placeholderSuffix, String valueSeparator, boolean ignoreUnresolvablePlaceholders) Creates a new
| |
| findPlaceholderEndIndex | back to summary |
|---|---|
| private int findPlaceholderEndIndex(CharSequence buf, int startIndex) | |
| parseStringValue | back to summary |
|---|---|
| protected String parseStringValue(String value, PropertyPlaceholderHelper. | |
| replacePlaceholders | back to summary |
|---|---|
| public String replacePlaceholders(String value, final Properties properties) Replaces all placeholders of format
| |
| replacePlaceholders | back to summary |
|---|---|
| public String replacePlaceholders(String value, PropertyPlaceholderHelper. Replaces all placeholders of format
| |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the replacement value, ornull if no replacement is to be madethe name of the placeholder to resolve placeholderName)Resolve the supplied placeholder name to the replacement value. |
| resolvePlaceholder | back to summary |
|---|---|
| public String resolvePlaceholder(String placeholderName) Resolve the supplied placeholder name to the replacement value. | |