Class StringSubstitutorUtil


  • public class StringSubstitutorUtil
    extends Object
    Utility methods for string substitution needs in midPoint. Uses Apache Commons Text StringSubstitutor. (Of course, you can - and perhaps should - call StringSubstitutor directly in the code. Here we provide some commonly-used methods that require custom configuration of the substitutor.)
    • Constructor Detail

      • StringSubstitutorUtil

        public StringSubstitutorUtil()
    • Method Detail

      • simpleExpand

        public static String simpleExpand​(String template,
                                          @NotNull
                                          Map<String,​String> replacements)
        Evaluates a template against set of replacement mappings. The string(s) to be matched are denoted by "{key}" sequence(s). This is a legacy method. We should use the "$" sign in the future.
        Parameters:
        template - Template e.g. "{masterTaskName} ({index})"
        replacements - Map of e.g. "masterTaskName" -> "Reconciliation", "index" -> "1"
        Returns:
        resolved template, e.g. "Reconciliation (1)"