Package com.google.template.soy.tofu.restricted

Examples of com.google.template.soy.tofu.restricted.SoyTofuPrintDirective


  @Override protected SoyData applyDirective(
      String directiveName, SoyData value, List<SoyData> args, SoyNode node) {

    // Get directive.
    SoyTofuPrintDirective directive = soyTofuDirectivesMap.get(directiveName);
    if (directive == null) {
      throw new RenderException(
          "Failed to find Soy print directive with name '" + directiveName + "'" +
          " (tag " + node.toSourceString() + ")");
    }

    // TODO: Add a pass to check num args at compile time.
    if (! directive.getValidArgsSizes().contains(args.size())) {
      throw new RenderException(
          "Print directive '" + directiveName + "' used with the wrong number of" +
          " arguments (tag " + node.toSourceString() + ").");
    }

    return directive.applyForTofu(value, args);
  }
View Full Code Here

TOP

Related Classes of com.google.template.soy.tofu.restricted.SoyTofuPrintDirective

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.