Top Description Methods
groovy.text.markup

public Interface TemplateResolver

Known Direct Implementers
groovy.text.markup.MarkupTemplateEngine.DefaultTemplateResolver
Imports
java.io.IOException, java.net.URL

Interface for template resolvers, which, given a template identifier, return an URL where the template can be loaded.

Method Summary

Modifier and TypeMethod and Description
public void
configure(ClassLoader
the classloader where templates will be searched for
templateClassLoader
,
TemplateConfiguration
the configuration of the template engine
configuration
)

This method is called once the template engine is initialized, providing the resolver with the template engine configuration and its template class loader.

public URL

Returns:

the template URL, that will be used to load the template
resolveTemplate
(String
path to the template
templatePath
)

Resolvers must implement this method in order to resolve a template, given a template path.

Method Detail

configureback to summary
public void configure(ClassLoader templateClassLoader, TemplateConfiguration configuration)

This method is called once the template engine is initialized, providing the resolver with the template engine configuration and its template class loader.

Parameters
templateClassLoader:ClassLoader

the classloader where templates will be searched for

configuration:TemplateConfiguration

the configuration of the template engine

resolveTemplateback to summary
public URL resolveTemplate(String templatePath) throws IOException

Resolvers must implement this method in order to resolve a template, given a template path. They must return a valid URL or an IOException.

Parameters
templatePath:String

path to the template

Returns:URL

the template URL, that will be used to load the template