com.google.clearsilver.jsilver.interpreter
Class OptimizingTemplateFactory

java.lang.Object
  extended by com.google.clearsilver.jsilver.interpreter.OptimizingTemplateFactory
All Implemented Interfaces:
TemplateFactory

public class OptimizingTemplateFactory
extends Object
implements TemplateFactory

Wraps a template factory with a series of optimization steps. Any null optimization steps are ignored.


Constructor Summary
OptimizingTemplateFactory(TemplateFactory wrapped, OptimizerProvider... optimizers)
          Creates a factory from the given optimization steps that wraps another TemplateFactory.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptimizingTemplateFactory

public OptimizingTemplateFactory(TemplateFactory wrapped,
                                 OptimizerProvider... optimizers)
Creates a factory from the given optimization steps that wraps another TemplateFactory.

Parameters:
wrapped - the template factory instance to be wrapped.
optimizers - the optimizers to apply (null optimizations are ignored).
Method Detail

createTemp

public TemplateSyntaxTree createTemp(String content,
                                     EscapeMode escapeMode)
Description copied from interface: TemplateFactory
Create a temporary template from content.

Specified by:
createTemp in interface TemplateFactory
Parameters:
content - e.g. "Hello <cs var:name >"

find

public TemplateSyntaxTree find(String templateName,
                               ResourceLoader resourceLoader,
                               EscapeMode escapeMode)
Description copied from interface: TemplateFactory
Load a template from the source.

Specified by:
find in interface TemplateFactory
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.


Copyright © 2010-2012 Google. All Rights Reserved.