Package com.google.template.soy.soytree

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


  @Override protected void visitCallBasicNode(CallBasicNode node) {

    // Don't forget to visit content within CallParamContentNodes.
    visitChildren(node);

    TemplateBasicNode callee = templateRegistry.getBasicTemplate(node.getCalleeName());

    // Note the template may be null because we allow calls to external templates not within this
    // Soy file set.
    if (callee == null) {
      currTemplateVisitInfo.mayHaveIjParamsInExternalCalls = true;
View Full Code Here


              currTemplateNameForUserMsgs, calleeName),
          node);
    }

    // Check that the callee is either not in a delegate package or in the same delegate package.
    TemplateBasicNode callee = templateRegistry.getBasicTemplate(calleeName);
    if (callee != null) {
      String calleeDelPackageName = callee.getDelPackageName();
      if (calleeDelPackageName != null && ! calleeDelPackageName.equals(currDelPackageName)) {
        throw SoySyntaxExceptionUtils.createWithNode(
            String.format(
                "Found illegal call from '%s' to '%s', which is in a different delegate package.",
                currTemplateNameForUserMsgs, callee.getTemplateName()),
            node);
      }
    }
  }
View Full Code Here

    // We only want to recurse on calls that pass all data.
    if (!node.isPassingAllData()) {
      return;
    }

    TemplateBasicNode callee = templateRegistry.getBasicTemplate(node.getCalleeName());

    // Note the template may be null because we allow calls to external templates not within this
    // Soy file set.
    if (callee == null) {
      mayHaveIndirectParamsInExternalCalls = true;
View Full Code Here

      // We need to use the unnamespaced name in the command text since we'll be inserting this
      // template into a file node that already has a namespace declaration.
      TemplateNode clone;
      boolean useAttrStyleForName = tn.getCommandText().contains("name=");
      if (tn instanceof TemplateBasicNode) {
        TemplateBasicNode tbn = (TemplateBasicNode) tn;

        String derivedPartialName = (tn.getPartialTemplateName() != null) ?
            derivedName.substring(soyFileHeaderInfo.namespace.length()) : null;

        clone = new TemplateBasicNode(
            cloneId, soyFileHeaderInfo, derivedName, derivedPartialName,
            useAttrStyleForName, tbn.isOverride(), tn.isPrivate(),
            tn.getAutoescapeMode(), tn.getContentKind(), tn.getSoyDoc(), tn.getSyntaxVersion());

        if (! (derivedName.equals(clone.getTemplateName()) &&
            Objects.equal(derivedPartialName, clone.getPartialTemplateName()))) {
          throw new AssertionError();
View Full Code Here

TOP

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

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.