Class TemplateHandler

java.lang.Object
de.edgesoft.edgeutils.freemarker.TemplateHandler

public class TemplateHandler
extends java.lang.Object
Freemarker template handler.

Legal stuff

Copyright 2010-2020 Ekkart Kleinod ekleinod@edgesoft.de

This file is part of edgeutils.

edgeutils is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

edgeutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with edgeutils. If not, see http://www.gnu.org/licenses/.

Since:
0.12.0
Author:
Ekkart Kleinod
  • Constructor Summary

    Constructors 
    Constructor Description
    TemplateHandler()  
  • Method Summary

    Modifier and Type Method Description
    static freemarker.template.Configuration getConfiguration()
    Returns template configuration.
    static freemarker.template.Template loadTemplate​(java.lang.Class<? extends java.lang.Object> clsProvider, java.lang.String theTemplateName)
    Loads template.
    static freemarker.template.Template loadTemplate​(java.lang.String theTemplateName, java.io.File theTemplatePath)
    Loads template with given name from given path.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getConfiguration

      public static freemarker.template.Configuration getConfiguration()
      Returns template configuration.
      Returns:
      configuration
    • loadTemplate

      public static freemarker.template.Template loadTemplate​(java.lang.Class<? extends java.lang.Object> clsProvider, java.lang.String theTemplateName) throws java.io.IOException
      Loads template.
      Parameters:
      clsProvider - provider class
      theTemplateName - template filename
      Returns:
      template
      Throws:
      java.io.IOException
    • loadTemplate

      public static freemarker.template.Template loadTemplate​(java.lang.String theTemplateName, java.io.File theTemplatePath) throws java.io.IOException
      Loads template with given name from given path.
      Parameters:
      theTemplateName - template filename
      theTemplatePath - template path
      Returns:
      template
      Throws:
      java.io.IOException