com.google.clearsilver.jsilver.interpreter
Interface TemplateFactory

All Known Implementing Classes:
LoadingTemplateFactory, OptimizingTemplateFactory

public interface TemplateFactory

Responsible for creating/retrieving an AST tree for a template with a given name.

This interface always expects to take a ResourceLoader object from the caller. This helps guarantee that per-Template resourceLoaders are respected.


Method Summary
 TemplateSyntaxTree createTemp(String content, EscapeMode escapeMode)
          Create a temporary template from content.
 TemplateSyntaxTree find(String templateName, ResourceLoader resourceLoader, EscapeMode escapeMode)
          Load a template from the source.
 

Method Detail

find

TemplateSyntaxTree find(String templateName,
                        ResourceLoader resourceLoader,
                        EscapeMode escapeMode)
Load a template from the source.

Parameters:
templateName - e.g. some/path/to/template.cs
resourceLoader - use this ResourceLoader to locate the named template file and any included files.
escapeMode - the type of escaping to apply to the entire template.

createTemp

TemplateSyntaxTree createTemp(String content,
                              EscapeMode escapeMode)
Create a temporary template from content.

Parameters:
content - e.g. "Hello <cs var:name >"
escapeMode -
escapeMode - the type of escaping to apply to the entire template.


Copyright © 2010-2012 Google. All Rights Reserved.