Class TemplateCore

java.lang.Object
freemarker.core.Configurable
freemarker.core.TemplateCore
Direct Known Subclasses:
Template

public abstract class TemplateCore extends Configurable
Abstract base class for Template. Used to provide package-level access to secured internals used by Environment.
  • Constructor Details

  • Method Details

    • addMacro

      public void addMacro(freemarker.core.ast.Macro macro)
      Called by code internally to maintain a table of macros
      Throws:
      SecurityException - if the macro with this name already exists, getConfiguration().isSecure() returns true, there is a security manager in the JVM, and the caller of this method does not posess the "modifyTemplate" FreeMarker permission.
    • checkModifyTemplate

      protected static void checkModifyTemplate()
    • getMacros

      public Map<String,freemarker.core.ast.Macro> getMacros()
      Throws:
      SecurityException - if the getConfiguration().isSecure() returns true, there is a security manager in the JVM, and the caller of this method does not posess the "modifyTemplate" FreeMarker permission (since both the retrieved map and the macros in it are mutable).
    • dump

      public void dump(PrintStream ps)
      Dump the raw template in canonical form.
    • dump

      public void dump(Writer out) throws IOException
      Dump the raw template in canonical form.
      Throws:
      IOException
    • getRootElement

      protected freemarker.core.ast.TemplateElement getRootElement()
    • setRootElement

      protected void setRootElement(freemarker.core.ast.TemplateElement rootElement)