public class TemplateLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.util.Map<java.lang.String,BaseTemplate> |
templates |
Constructor and Description |
---|
TemplateLoader() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanCompiledCache()
Cleans the cache for all templates
|
static void |
cleanCompiledCache(java.lang.String key)
Cleans the specified key from the cache
|
static java.util.List<Template> |
getAllTemplate()
List all found templates
|
static java.lang.String |
getUniqueNumberForTemplateFile(java.lang.String path)
All loaded templates is cached in the templates-list using a key.
|
static Template |
load(java.lang.String path)
Load a template
|
static BaseTemplate |
load(java.lang.String key,
java.lang.String source)
Load a template from a String
|
static BaseTemplate |
load(java.lang.String key,
java.lang.String source,
boolean reload)
Clean the cache for that key Then load a template from a String
|
static Template |
load(VirtualFile file)
Load a template from a virtual file
|
static BaseTemplate |
loadString(java.lang.String source)
Load template from a String, but don't cache it
|
protected static java.util.Map<java.lang.String,BaseTemplate> templates
public static java.lang.String getUniqueNumberForTemplateFile(java.lang.String path)
path
- Path of the template filepublic static Template load(VirtualFile file)
file
- A VirtualFilepublic static BaseTemplate load(java.lang.String key, java.lang.String source)
key
- A unique identifier for the template, used for retrieving a cached templatesource
- The template sourcepublic static BaseTemplate load(java.lang.String key, java.lang.String source, boolean reload)
key
- A unique identifier for the template, used for retrieving a cached templatesource
- The template sourcereload
- : Indicate if we must clean the cachepublic static BaseTemplate loadString(java.lang.String source)
source
- The template sourcepublic static void cleanCompiledCache()
public static void cleanCompiledCache(java.lang.String key)
key
- The template keypublic static Template load(java.lang.String path)
path
- The path of the template (ex: Application/index.html)public static java.util.List<Template> getAllTemplate()
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly