test_class.file: handlebars-maven-plugin/src/test/java/com/github/jknack/handlebars/maven/PrecompilePluginTest.java
test_class.identifier: PrecompilePluginTest
test_case.body: @Test
    public void i18nJs() throws Exception {
      PrecompilePlugin plugin = new PrecompilePlugin();
      plugin.setPrefix("src/test/resources/i18nJs");
      plugin.setSuffix(".html");
      plugin.setOutput("target/helpers-i18njs.js");
      plugin.setProject(newProject());
      plugin.setHandlebarsJsFile("/handlebars-v4.7.6.js");
  
      plugin.execute();
  
      assertEquals(FileUtils.fileRead("target/helpers-i18njs.js"),
          FileUtils.fileRead("src/test/resources/helpers-i18njs.expected").trim(),
          FileUtils.fileRead("target/helpers-i18njs.js").trim());
    }
test_case.class_method_signature: PrecompilePluginTest.i18nJs()
test_case.full_signature: @Test public void i18nJs()
test_case.identifier: i18nJs
test_case.invocations: setPrefix setSuffix setOutput setProject newProject setHandlebarsJsFile execute assertEquals fileRead trim fileRead trim fileRead
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void i18nJs()
focal_class.declarator: prefix
focal_class.modifier: @Parameter(defaultValue = "${basedir}/src/main/webapp")
    private
focal_class.original_string: @Parameter(defaultValue = "${basedir}/src/main/webapp")
    private String prefix;
focal_class.type: String
focal_class.var_name: prefix
focal_class.declarator: suffix = ".hbs"
focal_class.modifier: @Parameter(defaultValue = ".hbs")
    private
focal_class.original_string: @Parameter(defaultValue = ".hbs")
    private String suffix = ".hbs";
focal_class.type: String
focal_class.var_name: suffix
focal_class.declarator: templates
focal_class.modifier: @Parameter
    private
focal_class.original_string: @Parameter
    private List<String> templates;
focal_class.type: List<String>
focal_class.var_name: templates
focal_class.declarator: output
focal_class.modifier: @Parameter(defaultValue = "${project.build.directory}/${project.build.finalName}/js/helpers.js")
    private
focal_class.original_string: @Parameter(defaultValue = "${project.build.directory}/${project.build.finalName}/js/helpers.js")
    private String output;
focal_class.type: String
focal_class.var_name: output
focal_class.declarator: handlebarsJsFile
focal_class.modifier: @Parameter(defaultValue = "/handlebars-v4.7.6.js")
    private
focal_class.original_string: @Parameter(defaultValue = "/handlebars-v4.7.6.js")
    private String handlebarsJsFile;
focal_class.type: String
focal_class.var_name: handlebarsJsFile
focal_class.declarator: runtime
focal_class.modifier: @Parameter
    private
focal_class.original_string: @Parameter
    private String runtime;
focal_class.type: String
focal_class.var_name: runtime
focal_class.declarator: minimize
focal_class.modifier: @Parameter
    private
focal_class.original_string: @Parameter
    private boolean minimize;
focal_class.type: boolean
focal_class.var_name: minimize
focal_class.declarator: amd
focal_class.modifier: @Parameter
    private
focal_class.original_string: @Parameter
    private boolean amd;
focal_class.type: boolean
focal_class.var_name: amd
focal_class.declarator: encoding = "UTF-8"
focal_class.modifier: @Parameter
    private
focal_class.original_string: @Parameter
    private String encoding = "UTF-8";
focal_class.type: String
focal_class.var_name: encoding
focal_class.file: handlebars-maven-plugin/src/main/java/com/github/jknack/handlebars/maven/PrecompilePlugin.java
focal_class.identifier: PrecompilePlugin
focal_class.class_method_signature: PrecompilePlugin.doExecute()
focal_class.full_signature: @Override protected void doExecute()
focal_class.identifier: doExecute
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void doExecute()
focal_class.class_method_signature: PrecompilePlugin.silentHelpers(final Handlebars handlebars)
focal_class.full_signature: private void silentHelpers(final Handlebars handlebars)
focal_class.identifier: silentHelpers
focal_class.modifiers: private
focal_class.parameters: (final Handlebars handlebars)
focal_class.return: void
focal_class.signature: void silentHelpers(final Handlebars handlebars)
focal_class.class_method_signature: PrecompilePlugin.i18n(final Handlebars handlebars)
focal_class.full_signature: private void i18n(final Handlebars handlebars)
focal_class.identifier: i18n
focal_class.modifiers: private
focal_class.parameters: (final Handlebars handlebars)
focal_class.return: void
focal_class.signature: void i18n(final Handlebars handlebars)
focal_class.class_method_signature: PrecompilePlugin.i18nJs(final Handlebars handlebars, final List<CharSequence> extras,
        final URL[] classpath)
focal_class.full_signature: private void i18nJs(final Handlebars handlebars, final List<CharSequence> extras,
        final URL[] classpath)
focal_class.identifier: i18nJs
focal_class.modifiers: private
focal_class.parameters: (final Handlebars handlebars, final List<CharSequence> extras,
        final URL[] classpath)
focal_class.return: void
focal_class.signature: void i18nJs(final Handlebars handlebars, final List<CharSequence> extras,
        final URL[] classpath)
focal_class.class_method_signature: PrecompilePlugin.registerHelper(final String name, final String body, final String... args)
focal_class.full_signature: private CharSequence registerHelper(final String name, final String body, final String... args)
focal_class.identifier: registerHelper
focal_class.modifiers: private
focal_class.parameters: (final String name, final String body, final String... args)
focal_class.return: CharSequence
focal_class.signature: CharSequence registerHelper(final String name, final String body, final String... args)
focal_class.class_method_signature: PrecompilePlugin.minimize(final File output)
focal_class.full_signature: private void minimize(final File output)
focal_class.identifier: minimize
focal_class.modifiers: private
focal_class.parameters: (final File output)
focal_class.return: void
focal_class.signature: void minimize(final File output)
focal_class.class_method_signature: PrecompilePlugin.setRuntime(final String runtime)
focal_class.full_signature: public void setRuntime(final String runtime)
focal_class.identifier: setRuntime
focal_class.modifiers: public
focal_class.parameters: (final String runtime)
focal_class.return: void
focal_class.signature: void setRuntime(final String runtime)
focal_class.class_method_signature: PrecompilePlugin.setMinimize(final boolean minimize)
focal_class.full_signature: public void setMinimize(final boolean minimize)
focal_class.identifier: setMinimize
focal_class.modifiers: public
focal_class.parameters: (final boolean minimize)
focal_class.return: void
focal_class.signature: void setMinimize(final boolean minimize)
focal_class.class_method_signature: PrecompilePlugin.setOutput(final String output)
focal_class.full_signature: public void setOutput(final String output)
focal_class.identifier: setOutput
focal_class.modifiers: public
focal_class.parameters: (final String output)
focal_class.return: void
focal_class.signature: void setOutput(final String output)
focal_class.class_method_signature: PrecompilePlugin.setAmd(final boolean amd)
focal_class.full_signature: public void setAmd(final boolean amd)
focal_class.identifier: setAmd
focal_class.modifiers: public
focal_class.parameters: (final boolean amd)
focal_class.return: void
focal_class.signature: void setAmd(final boolean amd)
focal_class.class_method_signature: PrecompilePlugin.setPrefix(final String prefix)
focal_class.full_signature: public void setPrefix(final String prefix)
focal_class.identifier: setPrefix
focal_class.modifiers: public
focal_class.parameters: (final String prefix)
focal_class.return: void
focal_class.signature: void setPrefix(final String prefix)
focal_class.class_method_signature: PrecompilePlugin.setSuffix(final String suffix)
focal_class.full_signature: public void setSuffix(final String suffix)
focal_class.identifier: setSuffix
focal_class.modifiers: public
focal_class.parameters: (final String suffix)
focal_class.return: void
focal_class.signature: void setSuffix(final String suffix)
focal_class.class_method_signature: PrecompilePlugin.addTemplate(final String template)
focal_class.full_signature: public void addTemplate(final String template)
focal_class.identifier: addTemplate
focal_class.modifiers: public
focal_class.parameters: (final String template)
focal_class.return: void
focal_class.signature: void addTemplate(final String template)
focal_class.class_method_signature: PrecompilePlugin.setHandlebarsJsFile(final String handlebarsJsFile)
focal_class.full_signature: public void setHandlebarsJsFile(final String handlebarsJsFile)
focal_class.identifier: setHandlebarsJsFile
focal_class.modifiers: public
focal_class.parameters: (final String handlebarsJsFile)
focal_class.return: void
focal_class.signature: void setHandlebarsJsFile(final String handlebarsJsFile)
focal_class.superclass: extends HandlebarsPlugin
focal_method.body: private void i18nJs(final Handlebars handlebars, final List<CharSequence> extras,
        final URL[] classpath) {
      handlebars.registerHelper(I18nHelper.i18nJs.name(), new Helper<String>() {
        @Override
        public Object apply(final String context, final Options options) throws IOException {
          StringBuilder output = new StringBuilder();
          output.append("// i18nJs output:\n");
          output.append("// register an empty i18nJs helper:\n");
          output.append(registerHelper(I18nHelper.i18nJs.name(),
              "I18n.locale = arguments[0] || \"" + Locale.getDefault() + "\";\n"
              + "return '';", "arguments"));
          output.append("// redirect i18n helper to i18n.js:\n");
          output.append(registerHelper(I18nHelper.i18n.name(), "var key = arguments[0],\n"
              + "  i18nOpts = {},\n"
              + "  len = arguments.length - 1,"
              + "  options = arguments[len];\n"
              + "for(var i = 1; i < len; i++) {\n"
              + "  i18nOpts['arg' + (i - 1)] = arguments[i];\n"
              + "}\n"
              + "i18nOpts.locale = options.hash.locale;\n"
              + "return I18n.t(key, i18nOpts);"));
          extras.add(output);
          return null;
        }
  
        @Override
        public String toString() {
          return I18nHelper.i18nJs.name() + "-maven-plugin";
        }
      });
    }
focal_method.class_method_signature: PrecompilePlugin.i18nJs(final Handlebars handlebars, final List<CharSequence> extras,
        final URL[] classpath)
focal_method.full_signature: private void i18nJs(final Handlebars handlebars, final List<CharSequence> extras,
        final URL[] classpath)
focal_method.identifier: i18nJs
focal_method.invocations: registerHelper name append append append registerHelper name getDefault append append registerHelper name add name
focal_method.modifiers: private
focal_method.parameters: (final Handlebars handlebars, final List<CharSequence> extras,
        final URL[] classpath)
focal_method.return: void
focal_method.signature: void i18nJs(final Handlebars handlebars, final List<CharSequence> extras,
        final URL[] classpath)