From df1cf9286f03bca65a8fb41df5b3a40bb3279e07 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 11 Mar 2014 07:47:11 -0700 Subject: [PATCH] Override is good in code, a distraction in docs. --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 405b478..84394d3 100644 --- a/README.md +++ b/README.md @@ -432,23 +432,19 @@ other languages or contexts: "{{^condition}}result if false{{/condition}}"; Mustache.compiler().compile(template).execute(new Object() { Mustache.InvertibleLambda condition = new Mustache.InvertibleLambda() { - @Override - public void execute(Template.Fragment frag, Writer out) throws IOException { + public void execute (Template.Fragment frag, Writer out) throws IOException { // this method is executed when the lambda is referenced in a normal section out.write("if (condition) {console.log(\""); out.write(toJavaScriptLiteral(frag.execute())); out.write("\")}"); } - - @Override - public void executeInverse(Template.Fragment frag, Writer out) throws IOException { + public void executeInverse (Template.Fragment frag, Writer out) throws IOException { // this method is executed when the lambda is referenced in an inverse section out.write("if (!condition) {console.log(\""); out.write(toJavaScriptLiteral(frag.execute())); out.write("\")}"); } - - private String toJavaScriptLiteral(String execute) { + private String toJavaScriptLiteral (String execute) { // note: this is NOT a complete implementation of JavaScript string literal escaping return execute.replaceAll("\\\\", "\\\\\\\\").replaceAll("\"", "\\\\\""); }