From 718639127ed217b6650a2dbc4e08cfe4245ee73a Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 22 Nov 2011 11:40:09 -0800 Subject: [PATCH] Added comments and squeezed into 100 columns. --- src/main/java/com/samskivert/mustache/Template.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/samskivert/mustache/Template.java b/src/main/java/com/samskivert/mustache/Template.java index 3204a6a..ea0f629 100644 --- a/src/main/java/com/samskivert/mustache/Template.java +++ b/src/main/java/com/samskivert/mustache/Template.java @@ -56,9 +56,17 @@ public class Template executeSegs(new Context(context, null, 0, false, false), out); } + /** + * Executes this template with the supplied context and parent context, writing the results to + * the supplied writer. The parent context will be searched for variables that cannot be found + * in the main context, in the same way the main context becomes a parent context when entering + * a block. + * @throws MustacheException if an error occurs while executing or writing the template. + */ public void execute (Object context, Object parentContext, Writer out) throws MustacheException { - executeSegs(new Context(context, new Context(parentContext, null, 0, false, false), 0, false, false), out); + Context pctx = new Context(parentContext, null, 0, false, false); + executeSegs(new Context(context, pctx, 0, false, false), out); } protected Template (Segment[] segs, Mustache.Compiler compiler)