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

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


  private void applyCheckFunctionCallsVisitor(String soyContent, boolean allowExterns)
      throws Exception {
    SoyFileSetNode fileSet = SharedTestUtils.parseSoyFiles(soyContent);
    Map<String, SoyFunction> soyFunctions = ImmutableMap.<String, SoyFunction>of(
        "min",
        new SoyFunction() {
          public @Override String getName() {
            return "min";
          }

          public @Override Set<Integer> getValidArgsSizes() {
View Full Code Here


            throw new AssertionError("Unrecognized nonplugin fn " + nonpluginFn);
        }

      } else {
        // --- Check plugin function. ---
        SoyFunction signature = soyFunctionsByName.get(fnName);
        if (signature != null) {
          Set<Integer> arities = signature.getValidArgsSizes();
          // Check arity.
          if (!arities.contains(numArgs)) {
            throw SoySyntaxException.createWithoutMetaInfo(
                "Function '" + fnName + "' called with the wrong number of arguments" +
                    " (function call \"" + node.toSourceString() + "\").");
View Full Code Here

TOP

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

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.