Package com.google.template.soy.shared.restricted

Examples of com.google.template.soy.shared.restricted.SoyJavaRuntimePrintDirective


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

    // Get directive.
    SoyJavaRuntimePrintDirective directive = soyJavaRuntimeDirectivesMap.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() + ").");
    }

    try {
      return directive.apply(value, args);

    } catch (RuntimeException e) {
      throw new RenderException(String.format(
          "Failed in applying directive '%s' in tag \"%s\" due to exception: %s",
          directiveName, node.toSourceString(), e.getMessage()));
View Full Code Here

TOP

Related Classes of com.google.template.soy.shared.restricted.SoyJavaRuntimePrintDirective

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.