groovy.text.markup

## 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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MarkupTemplateEngine.CachingTemplateResolver` A template resolver which avoids calling `ClassLoader.getResource(String)` if a template path already has been queried before.
    `static class` | `MarkupTemplateEngine.DefaultTemplateResolver`
    `static class` | `MarkupTemplateEngine.TemplateResource`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MarkupTemplateEngine()`
    `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
    `MarkupTemplateEngine(java.lang.ClassLoader parentLoader, TemplateConfiguration tplConfig)`
    `MarkupTemplateEngine(java.lang.ClassLoader parentLoader, TemplateConfiguration tplConfig, TemplateResolver resolver)`
    `MarkupTemplateEngine(TemplateConfiguration tplConfig)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Template` | `createTemplate(java.io.Reader reader)`
    `Template` | `createTemplate(java.io.Reader reader, java.lang.String sourceName)`
    `Template` | `createTemplate(java.net.URL resource)`
    `Template` | `createTemplateByPath(java.lang.String templatePath)`
    `Template` | `createTypeCheckedModelTemplate(java.io.Reader reader, java.util.Map<java.lang.String,java.lang.String> modelTypes)`
    `Template` | `createTypeCheckedModelTemplate(java.io.Reader reader, java.lang.String sourceName, java.util.Map<java.lang.String,java.lang.String> modelTypes)`
    `Template` | `createTypeCheckedModelTemplate(java.lang.String source, java.util.Map<java.lang.String,java.lang.String> modelTypes)`
    `Template` | `createTypeCheckedModelTemplate(java.lang.String source, java.lang.String sourceName, java.util.Map<java.lang.String,java.lang.String> modelTypes)`
    `Template` | `createTypeCheckedModelTemplate(java.net.URL resource, java.util.Map<java.lang.String,java.lang.String> modelTypes)`
    `Template` | `createTypeCheckedModelTemplateByPath(java.lang.String templatePath, java.util.Map<java.lang.String,java.lang.String> modelTypes)`
    `CompilerConfiguration` | `getCompilerConfiguration()`
    `TemplateConfiguration` | `getTemplateConfiguration()`
    `GroovyClassLoader` | `getTemplateLoader()`
    `java.net.URL` | `resolveTemplate(java.lang.String templatePath)`

    - ### Methods inherited from class groovy.text.TemplateEngine

      `createTemplate, createTemplate`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MarkupTemplateEngine

          public MarkupTemplateEngine()

    - #### MarkupTemplateEngine

          public MarkupTemplateEngine(TemplateConfiguration tplConfig)

    - #### MarkupTemplateEngine

          public MarkupTemplateEngine(java.lang.ClassLoader parentLoader,
                                      TemplateConfiguration tplConfig)

    - #### MarkupTemplateEngine

          public MarkupTemplateEngine(java.lang.ClassLoader parentLoader,
                                      TemplateConfiguration tplConfig,
                                      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 Detail

    - #### createTemplate

          public Template createTemplate(java.io.Reader reader)
                                  throws CompilationFailedException,
                                         java.lang.ClassNotFoundException,
                                         java.io.IOException

      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

      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`