Package com.google.clearsilver.jsilver.compiler

Examples of com.google.clearsilver.jsilver.compiler.BaseCompiledTemplate


      Map<Object, String> templateToClassNameMap, FunctionExecutor globalFunctionExecutor) {
    Map<Object, BaseCompiledTemplate> templateMap = new HashMap<Object, BaseCompiledTemplate>();
    ClassLoader classLoader = getClass().getClassLoader();
    for (Map.Entry<Object, String> entry : templateToClassNameMap.entrySet()) {
      String className = entry.getValue();
      BaseCompiledTemplate compiledTemplate = loadTemplateObject(className, classLoader);
      // Fill in the necessary
      compiledTemplate.setFunctionExecutor(globalFunctionExecutor);
      compiledTemplate.setTemplateName(entry.getKey().toString());
      compiledTemplate.setTemplateLoader(this);
      if (entry.getKey() instanceof PrecompiledTemplateMapKey) {
        PrecompiledTemplateMapKey mapKey = (PrecompiledTemplateMapKey) entry.getKey();
        // The template's escapeMode is not currently used as the autoescaping is all
        // handled at compile time. Still set it in case it is needed later on.
        compiledTemplate.setEscapeMode(mapKey.getEscapeMode());
      } else {
        compiledTemplate.setEscapeMode(EscapeMode.ESCAPE_NONE);
      }
      compiledTemplate.setAutoEscapeOptions(autoEscapeOptions);
      templateMap.put(entry.getKey(), compiledTemplate);
    }
    return ImmutableMap.copyOf(templateMap);
  }
View Full Code Here

TOP

Related Classes of com.google.clearsilver.jsilver.compiler.BaseCompiledTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.