TemplateRendererImpl (Grails 6.0.0)

Package: grails.dev.commands.template

## [Groovy] Class TemplateRendererImpl

- grails.dev.commands.template.TemplateRendererImpl

- All Implemented Interfaces and Traits:
    TemplateRenderer

      @groovy.transform.CompileStatic
      class TemplateRendererImpl
      extends java.lang.Object
      implements TemplateRenderer

  API for locating and rendering templates in the code generation layer

  Authors:
    Graeme Rocher
  Since:
    3.2

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private grails.dev.commands.io.FileSystemInteraction` | `fileSystemInteraction` |
    `protected java.util.Map<java.lang.String, groovy.text.Template>` | `templateCache` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `grails.dev.commands.io.FileSystemInteraction` | `fileSystemInteraction`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `TemplateRendererImpl (java.io.File baseDir, ResourceLoader resourceLoader)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `render(java.util.Map<java.lang.String, java.lang.Object> namedArguments)` Render with the given named arguments
    `` | `void` | `render(java.lang.CharSequence template, java.io.File destination, Model model)` Render the given template to the give destination for the given model
    `` | `void` | `render(java.lang.CharSequence template, java.io.File destination, java.util.Map model, boolean overwrite)` Render the given template to the given destination
    `` | `void` | `render(java.io.File template, java.io.File destination, Model model)` Render the given template to the give destination for the given model
    `` | `void` | `render(java.io.File template, java.io.File destination, java.util.Map model, boolean overwrite)` Render the given template to the given destination
    `` | `void` | `render(Resource template, java.io.File destination, Model model, boolean overwrite)` Render the given template to the give destination for the given model
    `` | `void` | `render(Resource template, java.io.File destination, java.util.Map model, boolean overwrite)` Render the given template to the given destination
    `` | `Resource` | `template(java.lang.Object location)` Find a template at the given location
    `` | `java.lang.Iterable<Resource>` | `templates(java.lang.String pattern)` Find templates matching the given pattern
    `` | `protected static void` | `writeTemplateToDestination(groovy.text.Template template, java.util.Map model, java.io.File destination)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### @groovy.lang.Delegate private grails.dev.commands.io.FileSystemInteraction fileSystemInteraction

    - #### protected java.util.Map<java.lang.String, groovy.text.Template> templateCache

  - ### Property Detail

    - #### @groovy.lang.Delegate grails.dev.commands.io.FileSystemInteraction fileSystemInteraction

  - ### Constructor Detail

    - #### TemplateRendererImpl(java.io.File baseDir, ResourceLoader resourceLoader)

  - ### Method Detail

    - #### @java.lang.Override @groovy.transform.CompileDynamic void render(java.util.Map<java.lang.String, java.lang.Object> namedArguments)

      Render with the given named arguments

      Parameters:
        `namedArguments` - The named arguments are 'template', 'destination' and 'model'

    - #### @java.lang.Override void render(java.lang.CharSequence template, java.io.File destination, Model model)

      Render the given template to the give destination for the given model

      Parameters:
        `template` - The contents template
        `destination` - The destination
        `model` - The model

    - #### void render(java.lang.CharSequence template, java.io.File destination, java.util.Map model, boolean overwrite)

      Render the given template to the given destination

      Parameters:
        `template` - The contents of the template
        `destination` - The destination
        `model` - The model

    - #### void render(java.io.File template, java.io.File destination, Model model)

      Render the given template to the give destination for the given model

      Parameters:
        `template` - The template
        `destination` - The destination
        `model` - The model

    - #### void render(java.io.File template, java.io.File destination, java.util.Map model, boolean overwrite)

      Render the given template to the given destination

      Parameters:
        `template` - The template
        `destination` - The destination
        `model` - The model

    - #### void render(Resource template, java.io.File destination, Model model, boolean overwrite)

      Render the given template to the give destination for the given model

      Parameters:
        `template` - The contents template
        `destination` - The destination
        `model` - The model

    - #### void render(Resource template, java.io.File destination, java.util.Map model, boolean overwrite)

      Render the given template to the given destination

      Parameters:
        `template` - The template
        `destination` - The destination
        `model` - The model

    - #### Resource template(java.lang.Object location)

      Find a template at the given location

      Parameters:
        `location` - The location
      Returns:
        The resource or null if it doesn't exist

    - #### java.lang.Iterable<Resource> templates(java.lang.String pattern)

      Find templates matching the given pattern

      Parameters:
        `pattern` - The pattern
      Returns:
        The available templates

    - #### protected static void writeTemplateToDestination(groovy.text.Template template, java.util.Map model, java.io.File destination)