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