Package: groovy.text.markup

## [Java] Class MarkupTemplateEngine.CachingTemplateResolver

- groovy.text.markup.MarkupTemplateEngine.CachingTemplateResolver

- A template resolver which avoids calling ClassLoader.getResource if a template path already has been queried before. This improves performance if caching is enabled in the configuration.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected Map<String, URL>` | `cache` |
    `protected boolean` | `useCache` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `CachingTemplateResolver (Map<String, URL> cache)` Creates a new caching template resolver.
    `CachingTemplateResolver ()` Creates a new caching template resolver using a concurrent hash map as the backing cache.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `configure(ClassLoader templateClassLoader, TemplateConfiguration configuration)`
    `` | `URL` | `resolveTemplate(String templatePath)`

- - ### Field Detail

    - #### protected final Map<String, URL> cache

    - #### protected boolean useCache

  - ### Constructor Detail

    - #### public CachingTemplateResolver(Map<String, URL> cache)

      Creates a new caching template resolver. The cache implementation being used depends on the use of the template engine. If multiple templates can be rendered in parallel, it must be using a thread-safe cache.

      Parameters:
        `cache` - the backing cache

    - #### public CachingTemplateResolver()

      Creates a new caching template resolver using a concurrent hash map as the backing cache.

  - ### Method Detail

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void configure(ClassLoader templateClassLoader, TemplateConfiguration configuration)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public URL resolveTemplate(String templatePath)