net.sf.jelly.apt.strategies
Class TemplateBlockStrategy<B extends TemplateBlock>

java.lang.Object
  extended by net.sf.jelly.apt.strategies.TemplateStrategyControl<B>
      extended by net.sf.jelly.apt.strategies.TemplateBlockStrategy<B>
All Implemented Interfaces:
TemplateStrategy<B>
Direct Known Subclasses:
IfHasAnnotationStrategy, IfHasDeclarationStrategy, TemplateLoopStrategy, TemplateOutputRedirectionStrategy, UnwrapIfPrimitiveStrategy, WrapIfPrimitiveStrategy

public abstract class TemplateBlockStrategy<B extends TemplateBlock>
extends TemplateStrategyControl<B>

A strategy for outputing a template block.

Author:
Ryan Heaton

Constructor Summary
TemplateBlockStrategy()
           
 
Method Summary
 void postProcess(B block, TemplateOutput<B> output, TemplateModel model)
          Pops this strategy off the stack.
 boolean preProcess(B block, TemplateOutput<B> output, TemplateModel model)
          Pushes this strategy on the stack and redirects the output.
 boolean processBody(B block, TemplateOutput<B> output, TemplateModel model)
          Writes the body to the output.
 
Methods inherited from class net.sf.jelly.apt.strategies.TemplateStrategyControl
invoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateBlockStrategy

public TemplateBlockStrategy()
Method Detail

preProcess

public boolean preProcess(B block,
                          TemplateOutput<B> output,
                          TemplateModel model)
                   throws java.io.IOException,
                          TemplateException
Pushes this strategy on the stack and redirects the output.

Specified by:
preProcess in class TemplateStrategyControl<B extends TemplateBlock>
Parameters:
block - The block.
output - The output.
model - The model.
Returns:
true, as the body should be evaluated.
Throws:
java.io.IOException
TemplateException

processBody

public boolean processBody(B block,
                           TemplateOutput<B> output,
                           TemplateModel model)
                    throws java.io.IOException,
                           TemplateException
Writes the body to the output.

Specified by:
processBody in class TemplateStrategyControl<B extends TemplateBlock>
Parameters:
block - The block.
output - The output.
model - The model.
Returns:
false.
Throws:
java.io.IOException
TemplateException

postProcess

public void postProcess(B block,
                        TemplateOutput<B> output,
                        TemplateModel model)
                 throws java.io.IOException,
                        TemplateException
Pops this strategy off the stack.

Specified by:
postProcess in class TemplateStrategyControl<B extends TemplateBlock>
Parameters:
block - The block.
output - The output.
model - The model.
Throws:
java.io.IOException
TemplateException