Package org.openspaces.core.util
Class PlaceholderReplacer
java.lang.Object
org.openspaces.core.util.PlaceholderReplacer
- Author:
- Dan Kilman
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringreplacePlaceholders(Map<String, String> variables, String value) Replaces each occurrence of ${SOME_VALUE} or $(SOME_VALUE) with the variable SOME_VALUE in 'variables' If any error occurs during parsing, i.e: variable doesn't exist, bad syntax, etc...
-
Constructor Details
-
PlaceholderReplacer
public PlaceholderReplacer()
-
-
Method Details
-
replacePlaceholders
public static String replacePlaceholders(Map<String, String> variables, String value) throws PlaceholderReplacer.PlaceholderResolutionExceptionReplaces each occurrence of ${SOME_VALUE} or $(SOME_VALUE) with the variable SOME_VALUE in 'variables' If any error occurs during parsing, i.e: variable doesn't exist, bad syntax, etc... aPlaceholderReplacer.PlaceholderResolutionExceptionis thrown, otherwise the new string after all replacements have been made will be returned.- Parameters:
variables- The variables map to match placeholders againstvalue- the string, possibly containing placeholders- Returns:
- the value after placeholder replacement have been made
- Throws:
PlaceholderReplacer.PlaceholderResolutionException- if an empty placeholder is found or a placeholder with no suitable value in 'variables'
-