Class TemplateUtils


  • public class TemplateUtils
    extends Object
    • Constructor Detail

      • TemplateUtils

        private TemplateUtils()
    • Method Detail

      • evalBoolean

        public static Boolean evalBoolean​(String expr,
                                          Map<String,​Object> variableMap)
        Evaluate the template expression to boolean using a variable map.
        Parameters:
        expr - the expression
        variableMap - the variable map contains all the variables referenced in express
        Returns:
        whether the evaluated text is "true" or "false", default to false
      • evalText

        public static String evalText​(String expr,
                                      Map<String,​Object> variableMap)
        Evaluate the template expression using a variable map.
        Parameters:
        expr - the expression
        variableMap - the variable map contains all the variables referenced in express
        Returns:
        the evaluated text with color applied.
      • evalPlainText

        public static String evalPlainText​(String expr,
                                           Map<String,​Object> variableMap)
        Evaluate the template expression using a variable map.
        Parameters:
        expr - the expression
        variableMap - the variable map contains all the variables referenced in express
        Returns:
        the evaluated text.