@groovy.transform.CompileStatic @groovy.util.logging.Slf4j abstract class ResolvableGroovyTemplateEngine extends groovy.text.TemplateEngine
A TemplateEngine that can resolve templates using the configured TemplateResolver
Modifiers | Name | Description |
---|---|---|
class |
ResolvableGroovyTemplateEngine.1 |
Modifiers | Name | Description |
---|---|---|
private static WritableScriptTemplate |
NULL_ENTRY |
|
protected Cache<java.lang.String, WritableScriptTemplate> |
cachedTemplates |
|
private groovy.lang.GroovyClassLoader |
classLoader |
The class loader to use |
protected org.codehaus.groovy.control.CompilerConfiguration |
compilerConfiguration |
Whether to reload views |
private boolean |
enableReloading |
Whether to enable reloading |
private java.lang.String |
extension |
The view uri resolver |
private LinkGenerator |
linkGenerator |
|
private MappingContext |
mappingContext |
|
private MessageSource |
messageSource |
|
private MimeUtility |
mimeUtility |
|
private ProxyHandler |
proxyHandler |
|
protected Cache<java.util.List, WritableScriptTemplate> |
resolveCache |
|
private boolean |
shouldCache |
|
private int |
templateCounter |
|
private TemplateResolver |
templateResolver |
The TemplateResolver to use |
private ViewConfiguration |
viewConfiguration |
The view config |
private ViewUriResolver |
viewUriResolver |
The configuration to use for compilation |
Type | Name and description |
---|---|
groovy.lang.GroovyClassLoader |
classLoader The class loader to use |
boolean |
enableReloading Whether to enable reloading |
java.lang.String |
extension The view uri resolver |
boolean |
shouldCache |
groovy.text.markup.TemplateResolver |
templateResolver The TemplateResolver to use |
ViewConfiguration |
viewConfiguration The view config |
ViewUriResolver |
viewUriResolver The configuration to use for compilation |
Constructor and description |
---|
ResolvableGroovyTemplateEngine
(ViewConfiguration configuration, java.lang.ClassLoader classLoader) Creates a ResolvableGroovyTemplateEngine for the given base class name and file extension |
Type Params | Return Type | Name and description |
---|---|---|
|
private WritableScriptTemplate |
attemptResolveClass(java.lang.String path) |
|
private WritableScriptTemplate |
attemptResolvePath(java.lang.String path) |
|
protected WritableScriptTemplate |
createTemplate(java.lang.Class<? extends groovy.text.Template> cls) Creates a template for the given template class |
|
protected WritableScriptTemplate |
createTemplate(java.lang.Class<? extends groovy.text.Template> cls, java.io.File sourceFile) Creates a template for the given template class |
|
WritableScriptTemplate |
createTemplate(java.io.File file) |
|
WritableScriptTemplate |
createTemplate(java.net.URL url) |
|
WritableScriptTemplate |
createTemplate(java.lang.String path, java.net.URL url) |
|
WritableScriptTemplate |
createTemplate(java.io.Reader reader) |
|
private WritableScriptTemplate |
getCachedTemplatesWithDefault(java.lang.String key) |
|
org.codehaus.groovy.control.CompilerConfiguration |
getCompilerConfiguration() |
|
abstract java.lang.String |
getDynamicTemplatePrefix() |
|
protected WritableScriptTemplate |
initializeTemplate(GrailsViewTemplate template, java.io.File sourceFile) Initialises a template instance |
|
protected ViewsTransform |
newViewsTransform() |
|
protected void |
prepareCustomizers(org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration) |
|
WritableScriptTemplate |
resolveTemplate(java.lang.Class type, java.util.Locale locale, java.lang.String[] qualifiers) Resolves a template for the given object |
|
WritableScriptTemplate |
resolveTemplate(java.lang.String path) Resolves a template for the given path |
|
WritableScriptTemplate |
resolveTemplate(java.lang.String path, java.util.Locale locale, java.lang.String[] qualifiers) Resolves a template for the given path |
|
void |
setLinkGenerator(LinkGenerator linkGenerator) |
|
void |
setMappingContext(MappingContext mappingContext) |
|
void |
setMessageSource(MessageSource messageSource) |
|
void |
setMimeUtility(MimeUtility mimeUtility) |
|
void |
setProxyHandler(ProxyHandler proxyHandler) |
|
private WritableScriptTemplate |
templateByPath(java.lang.String path) |
Methods inherited from class | Name |
---|---|
class groovy.text.TemplateEngine |
groovy.text.TemplateEngine#createTemplate(java.net.URL), groovy.text.TemplateEngine#createTemplate(java.io.File, java.nio.charset.Charset), groovy.text.TemplateEngine#createTemplate(java.net.URL, java.nio.charset.Charset), groovy.text.TemplateEngine#createTemplate(java.io.File), groovy.text.TemplateEngine#createTemplate(java.io.Reader), groovy.text.TemplateEngine#createTemplate(java.lang.String), groovy.text.TemplateEngine#wait(long), groovy.text.TemplateEngine#wait(long, int), groovy.text.TemplateEngine#wait(), groovy.text.TemplateEngine#equals(java.lang.Object), groovy.text.TemplateEngine#toString(), groovy.text.TemplateEngine#hashCode(), groovy.text.TemplateEngine#getClass(), groovy.text.TemplateEngine#notify(), groovy.text.TemplateEngine#notifyAll() |
The class loader to use
Whether to reload views
Whether to enable reloading
The view uri resolver
The TemplateResolver to use
The view config
The configuration to use for compilation
The class loader to use
Whether to enable reloading
The view uri resolver
The TemplateResolver to use
The view config
The configuration to use for compilation
Creates a ResolvableGroovyTemplateEngine for the given base class name and file extension
baseClassName
- The base class nameextension
- The file extensionCreates a template for the given template class
cls
- The classCreates a template for the given template class
cls
- The classInitialises a template instance
template
- The created templatesourceFile
- The source fileResolves a template for the given object
object
- The objectqualifiers
- One or many qualifiers to scope the view (for example the locale, the version etc.)Resolves a template for the given path
path
- The path to the templateResolves a template for the given path
path
- The path to the templatequalifiers
- One or many qualifiers to scope the view (for example the locale, the version etc.)Groovy Documentation