com.google.clearsilver.jsilver.template
Interface TemplateLoader

All Known Subinterfaces:
DelegatingTemplateLoader
All Known Implementing Classes:
InterpretedTemplateLoader, PrecompiledTemplateLoader, TemplateCompiler

public interface TemplateLoader

Loads a Template.


Method Summary
 Template createTemp(String name, String content, EscapeMode escapeMode)
          Create a temporary template from content, with the provided escape mode.
 Template load(String templateName, ResourceLoader resourceLoader, EscapeMode escapeMode)
          Load a template from a named resource, with the provided escape mode.
 

Method Detail

load

Template load(String templateName,
              ResourceLoader resourceLoader,
              EscapeMode escapeMode)
Load a template from a named resource, with the provided escape mode. If the mode is ESCAPE_HTML, ESCAPE_URL or ESCAPE_JS, the corresponding escaping will be all variables in the template. If the mode is ESCAPE_AUTO, enable auto escaping on templates. For each variable in the template, this will determine what type of escaping should be applied to the variable, and automatically apply this escaping.

Parameters:
templateName - e.g. some/path/to/template.cs
resourceLoader - the ResourceLoader object to use to load any files needed to satisfy this request.
escapeMode - the type of escaping to apply to the entire template.

createTemp

Template createTemp(String name,
                    String content,
                    EscapeMode escapeMode)
Create a temporary template from content, with the provided escape mode. If the mode is ESCAPE_HTML, ESCAPE_URL or ESCAPE_JS, the corresponding escaping will be all variables in the template. If the mode is ESCAPE_AUTO, enable auto escaping on templates. For each variable in the template, this will determine what type of escaping should be applied to the variable, and automatically apply this escaping.

Parameters:
name - A name to identify the temporary template in stack traces.
content - e.g. "Hello <cs var:name >"
escapeMode - the type of escaping to apply to the entire template.


Copyright © 2010-2012 Google. All Rights Reserved.