public class PlaceholderReplacer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PlaceholderReplacer.PlaceholderResolutionException |
Constructor and Description |
---|
PlaceholderReplacer() |
Modifier and Type | Method and Description |
---|---|
static String |
replacePlaceholders(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...
|
public static String replacePlaceholders(Map<String,String> variables, String value) throws PlaceholderReplacer.PlaceholderResolutionException
PlaceholderReplacer.PlaceholderResolutionException
is thrown, otherwise the new string after all replacements
have been made will be returned.variables
- The variables map to match placeholders againstvalue
- the string, possibly containing placeholdersPlaceholderReplacer.PlaceholderResolutionException
- if an empty placeholder is found or a placeholder
with no suitable value in 'variables'Copyright © GigaSpaces.