Module jamal.engine
Package javax0.jamal

Class Format


  • public class Format
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Format()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(java.lang.String content, java.util.Map<java.lang.String,​java.lang.String> predefinedMacros)
      A simple formatting wrapper that formats a string using macros that are provided in a Map.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Format

        public Format()
    • Method Detail

      • format

        public static java.lang.String format​(java.lang.String content,
                                              java.util.Map<java.lang.String,​java.lang.String> predefinedMacros)
                                       throws BadSyntax
        A simple formatting wrapper that formats a string using macros that are provided in a Map. The Map is String String map and these macros cannot have arguments. This is a simple templating implementation using Jamal as a template engine.
        Parameters:
        content - the text that uses the macros
        predefinedMacros - the Map that contains the predefined macros
        Returns:
        the formatted string
        Throws:
        BadSyntax - in case the string cannot be formatted using the provided macros