com.google.template.soy.tofu
Class SoyTofuOptions

java.lang.Object
  extended by com.google.template.soy.tofu.SoyTofuOptions
All Implemented Interfaces:
Cloneable

public class SoyTofuOptions
extends Object
implements Cloneable

Compilation options for the Tofu backend.


Constructor Summary
SoyTofuOptions()
           
 
Method Summary
 SoyTofuOptions clone()
           
 void setUseCaching(boolean useCaching)
          Sets whether the resulting SoyTofu instance should cache intermediate results after substitutions from the SoyMsgBundle and the SoyCssRenamingMap.
 boolean useCaching()
          Returns whether the resulting SoyTofu instance should cache intermediate results after substitutions from the SoyMsgBundle and the SoyCssRenamingMap.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoyTofuOptions

public SoyTofuOptions()
Method Detail

setUseCaching

public void setUseCaching(boolean useCaching)
Sets whether the resulting SoyTofu instance should cache intermediate results after substitutions from the SoyMsgBundle and the SoyCssRenamingMap.

Specifically, if this param is set to true, then (a) The first time the SoyTofu is used with a new combination of SoyMsgBundle and SoyCssRenamingMap, the render will be slower. (Note that this first-render slowness can be eliminated by calling the method SoyTofu.addToCache(com.google.template.soy.msgs.SoyMsgBundle, com.google.template.soy.shared.SoyCssRenamingMap) to prime the cache.) (b) The subsequent times the SoyTofu is used with an already-seen combination of SoyMsgBundle and SoyCssRenamingMap, the render will be faster.

The cache will use memory proportional to the number of distinct combinations of SoyMsgBundle and SoyCssRenamingMap your app uses (note most apps have at most one SoyCssRenamingMap). If you find memory usage to be a problem, you can manually control the contents of the cache. See SoyTofu.Renderer.setDontAddToCache(boolean) for details.

Parameters:
useCaching - The value to set.

useCaching

public boolean useCaching()
Returns whether the resulting SoyTofu instance should cache intermediate results after substitutions from the SoyMsgBundle and the SoyCssRenamingMap.


clone

public SoyTofuOptions clone()
Overrides:
clone in class Object