Package org.apache.skywalking.apm.util
Enum Class PropertyPlaceholderHelper
- All Implemented Interfaces:
Serializable,Comparable<PropertyPlaceholderHelper>,Constable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceStrategy interface used to resolve replacement values for placeholders contained in Strings.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionprotected StringparseStringValue(String value, PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver, Set<String> visitedPlaceholders) replacePlaceholders(String value, Properties properties) Replaces all placeholders of format${name}with the corresponding property from the suppliedProperties.replacePlaceholders(String value, PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver) Replaces all placeholders of format${name}with the value returned from the suppliedPropertyPlaceholderHelper.PlaceholderResolver.static PropertyPlaceholderHelperReturns the enum constant of this class with the specified name.static PropertyPlaceholderHelper[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
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.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
replacePlaceholders
Replaces all placeholders of format${name}with the corresponding property from the suppliedProperties.- Parameters:
value- the value containing the placeholders to be replacedproperties- thePropertiesto use for replacement- Returns:
- 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 suppliedPropertyPlaceholderHelper.PlaceholderResolver.- Parameters:
value- the value containing the placeholders to be replacedplaceholderResolver- thePlaceholderResolverto use for replacement- Returns:
- the supplied value with placeholders replaced inline
-
parseStringValue
protected String parseStringValue(String value, PropertyPlaceholderHelper.PlaceholderResolver placeholderResolver, Set<String> visitedPlaceholders)
-