Package com.google.template.soy.soytree

Examples of com.google.template.soy.soytree.TemplateRegistry


   *     the data keys referenced in that template.
   */
  @Override protected void visitSoyFileSetNode(SoyFileSetNode node) {

    // Build templateRegistry.
    templateRegistry = new TemplateRegistry(node);

    // Run pass only on the Soy files that are all in V2 syntax.
    for (SoyFileNode soyFile : node.getChildren()) {
      // First determine if Soy file is all in V2 syntax.
      boolean isFileAllV2;
View Full Code Here


        }
      }
    }

    // Build template registry.
    templateRegistry = new TemplateRegistry(node);

    // Run the pass.
    for (SoyFileNode soyFile : node.getChildren()) {
      try {
        visit(soyFile);
View Full Code Here

    TemplateNode nodeAsTemplate = (TemplateNode) node;

    // Build templateRegistry and initialize templateToFinishedInfoMap if necessary.
    if (templateRegistry == null) {
      SoyFileSetNode soyTree = nodeAsTemplate.getParent().getParent();
      templateRegistry = new TemplateRegistry(soyTree);
    }
    if (templateToFinishedInfoMap == null) {
      templateToFinishedInfoMap = Maps.newHashMap();
    }
View Full Code Here

  @Override public List<String> exec(SoyNode soyNode) {

    Preconditions.checkArgument(soyNode instanceof SoyFileSetNode);

    templateRegistry = new TemplateRegistry((SoyFileSetNode) soyNode);
    super.exec(soyNode);

    return null;
  }
View Full Code Here

   */
  private TemplateRegistry buildTemplateRegistry(SoyFileSetNode soyTree) {

    (new MarkParentNodesNeedingEnvFramesVisitor()).exec(soyTree);
    (new MarkLocalVarDataRefsVisitor()).exec(soyTree);
    return new TemplateRegistry(soyTree);
  }
View Full Code Here

    // outside of an active apiCallScope, always running it within the apiCallScope allows it to
    // potentially do more, such as apply bidi functions/directives that require bidiGlobalDir to be
    // in scope.
    Preconditions.checkState(apiCallScope.isActive());

    TemplateRegistry templateRegistry = cachedTemplateRegistries.get(key);
    if (templateRegistry == null) {
      if (!doAddToCache) {
        return null;
      }
      SoyFileSetNode soyTreeClone = soyTree.clone();
View Full Code Here

      // Seed the scoped parameters.
      ApiCallScopeUtils.seedSharedParams(
          apiCallScope, msgBundle, 0 /*use msgBundle locale's direction, ltr if null*/);

      // Do the rendering.
      TemplateRegistry cachedTemplateRegistry = isCaching ?
          getCachedTemplateRegistry(Pair.of(msgBundle, cssRenamingMap), doAddToCache) : null;
      // Note: cachedTemplateRegistry may be null even when isCaching is true (specifically, if
      // doAddToCache is false).
      if (cachedTemplateRegistry != null) {
        // Note: Still need to pass msgBundle because we currently don't cache plural/select msgs.
View Full Code Here


  @Override public Void exec(SoyNode soyNode) {

    Preconditions.checkArgument(soyNode instanceof SoyFileSetNode);
    templateRegistry = new TemplateRegistry((SoyFileSetNode) soyNode);

    // Perform checks that only involve templates (uses templateRegistry only, no traversal).
    checkTemplates();

    // Perform checks that involve calls (uses traversal).
View Full Code Here

  @Override protected void visitTemplateNode(TemplateNode node) {

    // Build templateRegistry if necessary.
    if (templateRegistry == null) {
      SoyFileSetNode soyTree = node.getParent().getParent();
      templateRegistry = new TemplateRegistry(soyTree);
    }

    if (isStartOfPass) {
      isStartOfPass = false;
View Full Code Here

    Preconditions.checkArgument(
        soyNode instanceof SoyFileSetNode || soyNode instanceof SoyFileNode);

    mostRecentFailingNode = null;
    errorBuffer = new StringBuilder();
    templateRegistry = new TemplateRegistry(soyNode.getNearestAncestor(SoyFileSetNode.class));

    super.exec(soyNode);

    if (mostRecentFailingNode != null) {
      throw SoySyntaxExceptionUtils.createWithNode(errorBuffer.toString(), mostRecentFailingNode);
View Full Code Here

TOP

Related Classes of com.google.template.soy.soytree.TemplateRegistry

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.