public class IniPlaceholderHandler extends Object
${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 PlaceholderParser.
| 构造器和说明 |
|---|
IniPlaceholderHandler(String placeholderPrefix,
String placeholderSuffix)
Creates a new
PropertyPlaceholderHelper that uses the supplied prefix and suffix. |
IniPlaceholderHandler(String placeholderPrefix,
String placeholderSuffix,
String valueSeparator,
boolean ignoreUnresolvablePlaceholders)
Creates a new
PropertyPlaceholderHelper that uses the supplied prefix and suffix. |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
parseStringValue(String value,
String defaultSection,
PlaceholderParser placeholderParser,
Set<String> visitedPlaceholders) |
String |
replacePlaceholders(String value,
String defaultSection,
Ini ini)
Replaces all placeholders of format
${name} with the corresponding
property from the supplied Properties. |
String |
replacePlaceholders(String value,
String defaultSection,
PlaceholderParser placeholderResolver)
Replaces all placeholders of format
${name} with the value returned
from the supplied PlaceholderParser. |
public IniPlaceholderHandler(String placeholderPrefix, String placeholderSuffix)
PropertyPlaceholderHelper that uses the supplied prefix and suffix.
Unresolvable placeholders are ignored.placeholderPrefix - the prefix that denotes the start of a placeholderplaceholderSuffix - the suffix that denotes the end of a placeholderpublic IniPlaceholderHandler(String placeholderPrefix, String placeholderSuffix, @Nullable String valueSeparator, boolean ignoreUnresolvablePlaceholders)
PropertyPlaceholderHelper that uses the supplied prefix and suffix.placeholderPrefix - the prefix that denotes the start of a placeholderplaceholderSuffix - the suffix that denotes the end of a placeholdervalueSeparator - the separating character between the placeholder variable
and the associated default value, if anyignoreUnresolvablePlaceholders - indicates whether unresolvable placeholders should
be ignored (true) or cause an exception (false)public String replacePlaceholders(String value, String defaultSection, Ini ini)
${name} with the corresponding
property from the supplied Properties.value - the value containing the placeholders to be replacedini - the Properties to use for replacementpublic String replacePlaceholders(String value, String defaultSection, PlaceholderParser placeholderResolver)
${name} with the value returned
from the supplied PlaceholderParser.value - the value containing the placeholders to be replacedplaceholderResolver - the PlaceholderResolver to use for replacementCopyright © 2022. All rights reserved.