Class MarkupTemplateEngine

java.lang.Object
groovy.text.TemplateEngine
groovy.text.markup.MarkupTemplateEngine

public class MarkupTemplateEngine
extends TemplateEngine
A template engine which leverages StreamingMarkupBuilder to generate XML/XHTML.
  • Constructor Details

    • MarkupTemplateEngine

      public MarkupTemplateEngine()
    • MarkupTemplateEngine

      public MarkupTemplateEngine​(TemplateConfiguration config)
    • MarkupTemplateEngine

      public MarkupTemplateEngine​(java.lang.ClassLoader parentLoader, TemplateConfiguration config)
    • MarkupTemplateEngine

      public MarkupTemplateEngine​(java.lang.ClassLoader parentLoader, TemplateConfiguration config, TemplateResolver resolver)
    • MarkupTemplateEngine

      public MarkupTemplateEngine​(java.lang.ClassLoader parentLoader, java.io.File templateDirectory, TemplateConfiguration tplConfig)
      Convenience constructor to build a template engine which searches for templates into a directory
      Parameters:
      templateDirectory - directory where to find templates
      tplConfig - template engine configuration
  • Method Details

    • createTemplate

      public Template createTemplate​(java.io.Reader reader) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Description copied from class: TemplateEngine
      Creates a template by reading content from the Reader.
      Specified by:
      createTemplate in class TemplateEngine
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • createTemplate

      public Template createTemplate​(java.io.Reader reader, java.lang.String sourceName) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • createTemplateByPath

      public Template createTemplateByPath​(java.lang.String templatePath) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • createTypeCheckedModelTemplate

      public Template createTypeCheckedModelTemplate​(java.lang.String source, java.util.Map<java.lang.String,​java.lang.String> modelTypes) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • createTypeCheckedModelTemplate

      public Template createTypeCheckedModelTemplate​(java.lang.String source, java.lang.String sourceName, java.util.Map<java.lang.String,​java.lang.String> modelTypes) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • createTypeCheckedModelTemplate

      public Template createTypeCheckedModelTemplate​(java.io.Reader reader, java.util.Map<java.lang.String,​java.lang.String> modelTypes) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • createTypeCheckedModelTemplate

      public Template createTypeCheckedModelTemplate​(java.io.Reader reader, java.lang.String sourceName, java.util.Map<java.lang.String,​java.lang.String> modelTypes) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • createTypeCheckedModelTemplateByPath

      public Template createTypeCheckedModelTemplateByPath​(java.lang.String templatePath, java.util.Map<java.lang.String,​java.lang.String> modelTypes) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • createTemplate

      public Template createTemplate​(java.net.URL resource) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Description copied from class: TemplateEngine
      Creates a template from the content found at the URL using the default encoding. Please consider using TemplateEngine.createTemplate(URL, Charset).
      Overrides:
      createTemplate in class TemplateEngine
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • createTypeCheckedModelTemplate

      public Template createTypeCheckedModelTemplate​(java.net.URL resource, java.util.Map<java.lang.String,​java.lang.String> modelTypes) throws CompilationFailedException, java.lang.ClassNotFoundException, java.io.IOException
      Throws:
      CompilationFailedException
      java.lang.ClassNotFoundException
      java.io.IOException
    • getTemplateLoader

      public GroovyClassLoader getTemplateLoader()
    • getCompilerConfiguration

      public CompilerConfiguration getCompilerConfiguration()
    • getTemplateConfiguration

      public TemplateConfiguration getTemplateConfiguration()
    • resolveTemplate

      public java.net.URL resolveTemplate​(java.lang.String templatePath) throws java.io.IOException
      Throws:
      java.io.IOException