类 PropertyPlaceholderHelper


  • public class PropertyPlaceholderHelper
    extends Object
    Utility class for working with Strings that have placeholder values in them. A placeholder takes the form ${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 PropertyPlaceholderHelper.PlaceholderResolver.

    从以下版本开始:
    3.0
    作者:
    Juergen Hoeller, Rob Harrop
    • 构造器详细资料

      • PropertyPlaceholderHelper

        public PropertyPlaceholderHelper​(String placeholderPrefix,
                                         String placeholderSuffix)
        Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix. Unresolvable placeholders are ignored.
        参数:
        placeholderPrefix - the prefix that denotes the start of a placeholder
        placeholderSuffix - the suffix that denotes the end of a placeholder
      • PropertyPlaceholderHelper

        public PropertyPlaceholderHelper​(String placeholderPrefix,
                                         String placeholderSuffix,
                                         String valueSeparator,
                                         boolean ignoreUnresolvablePlaceholders)
        Creates a new PropertyPlaceholderHelper that uses the supplied prefix and suffix.
        参数:
        placeholderPrefix - the prefix that denotes the start of a placeholder
        placeholderSuffix - the suffix that denotes the end of a placeholder
        valueSeparator - the separating character between the placeholder variable and the associated default value, if any
        ignoreUnresolvablePlaceholders - indicates whether unresolvable placeholders should be ignored (true) or cause an exception (false)