Enum Class PropertyPlaceholderHelper

java.lang.Object
java.lang.Enum<PropertyPlaceholderHelper>
org.apache.skywalking.apm.util.PropertyPlaceholderHelper
所有已实现的接口:
Serializable, Comparable<PropertyPlaceholderHelper>, Constable

public enum PropertyPlaceholderHelper extends Enum<PropertyPlaceholderHelper>
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.

  • 枚举常量详细资料

  • 方法详细资料

    • values

      public static PropertyPlaceholderHelper[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      返回:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PropertyPlaceholderHelper valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - 如果参数为空值
    • replacePlaceholders

      public String replacePlaceholders(String value, Properties properties)
      Replaces all placeholders of format ${name} with the corresponding property from the supplied Properties.
      参数:
      value - the value containing the placeholders to be replaced
      properties - the Properties to use for replacement
      返回:
      the supplied value with placeholders replaced inline
    • replacePlaceholders

      public String replacePlaceholders(String value, PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver)
      Replaces all placeholders of format ${name} with the value returned from the supplied PropertyPlaceholderHelper.PlaceholderResolver.
      参数:
      value - the value containing the placeholders to be replaced
      placeholderResolver - the PlaceholderResolver to use for replacement
      返回:
      the supplied value with placeholders replaced inline
    • parseStringValue

      protected String parseStringValue(String value, PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver, Set<String> visitedPlaceholders)