/** * "visit" an IteratorBlock */ boolean visitIteratorBlock(IteratorBlock.IterationContext ictxt) throws TemplateException, IOException { pushLocalContext(ictxt); try { return ictxt.accept(this); } catch (TemplateException te) { handleTemplateException(te); return true; } finally { localContextStack.pop(); } }
pushLocalContext(new LocalContext() {
pushLocalContext(new LocalContext() { public TemplateModel getLocalVariable(String name) { int index = bodyParameterNames.indexOf(name);
/** * "visit" an IteratorBlock */ boolean visitIteratorBlock(IteratorBlock.IterationContext ictxt) throws TemplateException, IOException { pushLocalContext(ictxt); try { return ictxt.accept(this); } catch (TemplateException te) { handleTemplateException(te); return true; } finally { localContextStack.pop(); } }
/** * "visit" an IteratorBlock */ boolean visitIteratorBlock(IteratorBlock.IterationContext ictxt) throws TemplateException, IOException { pushLocalContext(ictxt); try { return ictxt.accept(this); } catch (TemplateException te) { handleTemplateException(te); return true; } finally { localContextStack.pop(); } }
/** * "visit" an IteratorBlock */ void visit(IteratorBlock.Context ictxt) throws TemplateException, IOException { pushLocalContext(ictxt); try { ictxt.runLoop(this); } catch (BreakInstruction.Break br) { } catch (TemplateException te) { handleTemplateException(te); } finally { popLocalContext(); } }
pushLocalContext(new LocalContext() {
pushLocalContext(new LocalContext() {
void visit(BodyInstruction.Context bctxt) throws TemplateException, IOException { Macro.Context invokingMacroContext = getCurrentMacroContext(); ArrayList prevLocalContextStack = localContextStack; TemplateElement body = invokingMacroContext.body; if (body != null) { this.currentMacroContext = invokingMacroContext.prevMacroContext; currentNamespace = invokingMacroContext.bodyNamespace; Configurable prevParent = getParent(); setParent(currentNamespace.getTemplate()); this.localContextStack = invokingMacroContext.prevLocalContextStack; if (invokingMacroContext.bodyParameterNames != null) { pushLocalContext(bctxt); } try { visit(body); } finally { if (invokingMacroContext.bodyParameterNames != null) { popLocalContext(); } this.currentMacroContext = invokingMacroContext; currentNamespace = getMacroNamespace(invokingMacroContext.getMacro()); setParent(prevParent); this.localContextStack = prevLocalContextStack; } } }
pushLocalContext(bodyCtx);