play.templates
Class TemplateLoader

java.lang.Object
  extended by play.templates.TemplateLoader

public class TemplateLoader
extends java.lang.Object

Load templates


Field Summary
protected static java.util.Map<java.lang.String,Template> templates
           
 
Constructor Summary
TemplateLoader()
           
 
Method Summary
static void cleanCompiledCache()
           
static java.util.List<Template> getAllTemplate()
          List all found templates
static Template load(java.lang.String path)
          Load a template
static Template load(java.lang.String key, java.lang.String source)
          Load a template from a String
static Template load(VirtualFile file)
          Load a template from a virtual file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templates

protected static java.util.Map<java.lang.String,Template> templates
Constructor Detail

TemplateLoader

public TemplateLoader()
Method Detail

load

public static Template load(VirtualFile file)
Load a template from a virtual file

Parameters:
file - A VirtualFile
Returns:
The executable template

load

public static Template load(java.lang.String key,
                            java.lang.String source)
Load a template from a String

Parameters:
key - A unique identifier for the template, used for retreiving a cached template
source - The template source, leave as null, if you want to get the cached template
Returns:
A Template

cleanCompiledCache

public static void cleanCompiledCache()

load

public static Template load(java.lang.String path)
Load a template

Parameters:
path - The path of the template (ex: Application/index.html)
Returns:
The executable template

getAllTemplate

public static java.util.List<Template> getAllTemplate()
List all found templates

Returns:
A list of executable templates


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly