Class MontiCoreTemplateLoader

java.lang.Object
freemarker.cache.URLTemplateLoader
de.monticore.generating.templateengine.freemarker.MontiCoreTemplateLoader
All Implemented Interfaces:
freemarker.cache.TemplateLoader

public class MontiCoreTemplateLoader extends freemarker.cache.URLTemplateLoader
Is used to load templates with a given ClassLoader.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final ClassLoader
    the used class loader
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new MontiCoreTemplateLoader that uses the given class loader to load FreeMarker templates from the class path
  • Method Summary

    Modifier and Type
    Method
    Description
    protected URL
    getURL(String templateName)
    Resolves the location of a template on the local machine.

    Methods inherited from class freemarker.cache.URLTemplateLoader

    canonicalizePrefix, closeTemplateSource, findTemplateSource, getLastModified, getReader, getURLConnectionUsesCaches, setURLConnectionUsesCaches

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • classLoader

      protected final ClassLoader classLoader
      the used class loader
  • Constructor Details

    • MontiCoreTemplateLoader

      public MontiCoreTemplateLoader(ClassLoader classLoader)
      Creates a new MontiCoreTemplateLoader that uses the given class loader to load FreeMarker templates from the class path
      Parameters:
      classLoader -
  • Method Details

    • getURL

      protected URL getURL(String templateName)
      Resolves the location of a template on the local machine.
      Specified by:
      getURL in class freemarker.cache.URLTemplateLoader
      Parameters:
      templateName - The qualified name of the Template. Example: "cd2data.core.Attribute" or "cd2data/core/Attribute" or "cd2data.core.Attribute.ftl"
      Returns:
      URL of the template on the local machine. Example: "jar:file:/C:/.../dex/gtr/target/dex-gtr-0.9.4-SNAPSHOT.jar!/cd2data/core/Attribute.ftl" (this is from the toString method of the URL object)
      See Also:
      • URLTemplateLoader.getURL(java.lang.String)