com.google.clearsilver.jsilver.precompiler
Class PrecompiledTemplateMapFileReader

java.lang.Object
  extended by com.google.clearsilver.jsilver.precompiler.PrecompiledTemplateMapFileReader

public class PrecompiledTemplateMapFileReader
extends Object

Utility class that reads in the file output by BatchCompiler that is a list of template names and corresponding class names and returns a Map of template filenames to class names which can be fed to JSilverOptions.setPrecompiledTemplateMap(java.util.Map)


Constructor Summary
PrecompiledTemplateMapFileReader(String filename, String dirPattern, String rootDir)
          Helper object that reads in the specified resource file and generates a mapping of template filenames to corresponding BaseCompiledTemplate class names.
 
Method Summary
protected  Reader getMapFileReader(String templateMapFile)
           
 Map<Object,String> getTemplateMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrecompiledTemplateMapFileReader

public PrecompiledTemplateMapFileReader(String filename,
                                        String dirPattern,
                                        String rootDir)
Helper object that reads in the specified resource file and generates a mapping of template filenames to corresponding BaseCompiledTemplate class names.

Parameters:
filename - name of the resource file to read the map from.
dirPattern - prefix to remove from read in template names. Used in conjunction with rootDir to update template file paths.
rootDir - optional string to prepend to all non-absolute template filenames. Should be set to the location of the templates in production via a flag.
Method Detail

getTemplateMap

public Map<Object,String> getTemplateMap()
                                  throws IOException
Throws:
IOException

getMapFileReader

protected Reader getMapFileReader(String templateMapFile)
                           throws IOException
Throws:
IOException


Copyright © 2010-2012 Google. All Rights Reserved.