play.templates
类 TemplateLoader

java.lang.Object
  继承者 play.templates.TemplateLoader

public class TemplateLoader
extends java.lang.Object

Load templates


字段摘要
protected static java.util.Map<java.lang.String,BaseTemplate> templates
           
 
构造方法摘要
TemplateLoader()
           
 
方法摘要
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
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

templates

protected static java.util.Map<java.lang.String,BaseTemplate> templates
构造方法详细信息

TemplateLoader

public TemplateLoader()
方法详细信息

getUniqueNumberForTemplateFile

public static java.lang.String getUniqueNumberForTemplateFile(java.lang.String path)
All loaded templates is cached in the templates-list using a key. This key is included as part of the classname for the generated class for a specific template. The key is included in the classname to make it possible to resolve the original template-file from the classname, when creating cleanStackTrace This method returns a unique representation of the path which is usable as part of a classname

参数:
path -
返回:

load

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

参数:
file - A VirtualFile
返回:
The executable template

load

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

参数:
key - A unique identifier for the template, used for retreiving a cached template
source - The template source
返回:
A Template

load

public 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

参数:
key - A unique identifier for the template, used for retreiving a cached template
source - The template source
返回:
A Template

loadString

public static BaseTemplate loadString(java.lang.String source)
Load template from a String, but don't cache it

参数:
source - The template source
返回:
A Template

cleanCompiledCache

public static void cleanCompiledCache()
Cleans the cache for all templates


cleanCompiledCache

public static void cleanCompiledCache(java.lang.String key)
Cleans the specified key from the cache

参数:
key - The template key

load

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

参数:
path - The path of the template (ex: Application/index.html)
返回:
The executable template

getAllTemplate

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

返回:
A list of executable templates


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