org.barracudamvc.core.comp.renderer
Class TemplateHelper

java.lang.Object
  extended byorg.barracudamvc.core.comp.renderer.TemplateHelper

public class TemplateHelper
extends Object

Provide a default encapsulation of the template rendering stuff.


Field Summary
protected  BTemplate btemplate
           
protected static String IT_STACK
           
protected static String ITERATIVE_MODEL_MAP
           
protected  Stack itStack
           
protected static org.apache.log4j.Logger logger
           
protected  Renderer masterRenderer
           
protected  boolean skipUntilBlockIterateEnd
           
 
Constructor Summary
TemplateHelper(Renderer imasterRenderer)
           
 
Method Summary
static void cleanupAfterBlockIterate()
           
protected  void copyChildNodes(Node templateNode, Node targetNode, TemplateView view, ViewContext vc, int depth)
          Copy nodes from the template to the target
protected  Node getNode(Node templateNode, TemplateView view, ViewContext vc, int depth)
          Given the specified templateNode, return the new Node to be rendered into the view
protected  void popstack()
           
protected  boolean postiterate(TemplateModel tm, TemplateDirective td)
          Handles the post iteration stuff; returns false if positeration has already occurred.
protected  boolean preiterate(Node templateNode, TemplateModel tm, TemplateDirective td)
          Handles the ITERATE_START tag; returns false if we can just continue preIterate() will only be called the first time.
 void render(BTemplate comp, TemplateView view, ViewContext vc)
          This renders a BTemplate component into the specified TemplateView, for the given ViewCOntext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

ITERATIVE_MODEL_MAP

protected static final String ITERATIVE_MODEL_MAP

IT_STACK

protected static final String IT_STACK

masterRenderer

protected Renderer masterRenderer

btemplate

protected BTemplate btemplate

itStack

protected Stack itStack

skipUntilBlockIterateEnd

protected boolean skipUntilBlockIterateEnd
Constructor Detail

TemplateHelper

public TemplateHelper(Renderer imasterRenderer)
Method Detail

render

public void render(BTemplate comp,
                   TemplateView view,
                   ViewContext vc)
            throws RenderException
This renders a BTemplate component into the specified TemplateView, for the given ViewCOntext

Throws:
RenderException

copyChildNodes

protected void copyChildNodes(Node templateNode,
                              Node targetNode,
                              TemplateView view,
                              ViewContext vc,
                              int depth)
                       throws RenderException
Copy nodes from the template to the target

Throws:
RenderException

getNode

protected Node getNode(Node templateNode,
                       TemplateView view,
                       ViewContext vc,
                       int depth)
                throws RenderException
Given the specified templateNode, return the new Node to be rendered into the view

Throws:
RenderException

preiterate

protected boolean preiterate(Node templateNode,
                             TemplateModel tm,
                             TemplateDirective td)
Handles the ITERATE_START tag; returns false if we can just continue preIterate() will only be called the first time. We break this out into a subroutine so that INTERATE_NEXT logic can also invoke it, meaning that you don't really have to have an ITERATE_START in your template (its now implicit in ITERATE_NEXT)


postiterate

protected boolean postiterate(TemplateModel tm,
                              TemplateDirective td)
Handles the post iteration stuff; returns false if positeration has already occurred. postIterate() will only be called the first time.


popstack

protected void popstack()

cleanupAfterBlockIterate

public static void cleanupAfterBlockIterate()


Copyright © 2004 BarracudaMVC.org All Rights Reserved.