Class JKTemplateUtil

java.lang.Object
com.jk.core.templates.JKTemplateUtil

public class JKTemplateUtil extends Object
This class is a utility class for compiling and processing FreeMarker templates.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • JKTemplateUtil

      public JKTemplateUtil()
  • Method Details

    • getConfig

      protected static freemarker.template.Configuration getConfig(String path)
      This method retrieves or initializes the FreeMarker configuration for template processing.
      Parameters:
      path - Specifies the path to the template directory.
      Returns:
      the FreeMarker configuration instance.
    • compile

      public static String compile(String path, String templateName, Map<String,Object> input)
      This compiles and processes a FreeMarker template.
      Parameters:
      path - Specifies the path to the template directory.
      templateName - Specifies the name of the template file.
      input - Specifies the input data to be used for template processing.
      Returns:
      the compiled and processed template content.