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

java.lang.Object
  extended by net.sf.jelly.apt.strategies.TemplateStrategyControl<B>
All Implemented Interfaces:
TemplateStrategy<B>
Direct Known Subclasses:
TemplateBlockStrategy, TemplateValueStrategy

public abstract class TemplateStrategyControl<B extends TemplateBlock>
extends java.lang.Object
implements TemplateStrategy<B>

Base strategy class that goes through a specific control process when invoked.

Author:
Ryan Heaton

Constructor Summary
TemplateStrategyControl()
           
 
Method Summary
 void invoke(B block, TemplateOutput<B> output, TemplateModel model)
          Invoke the strategy using the control process.
abstract  void postProcess(B block, TemplateOutput<B> output, TemplateModel model)
          Post-process the strategy.
abstract  boolean preProcess(B block, TemplateOutput<B> output, TemplateModel model)
          Pre-process the strategy.
abstract  boolean processBody(B block, TemplateOutput<B> output, TemplateModel model)
          Process the body of the block.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateStrategyControl

public TemplateStrategyControl()
Method Detail

preProcess

public abstract boolean preProcess(B block,
                                   TemplateOutput<B> output,
                                   TemplateModel model)
                            throws java.io.IOException,
                                   TemplateException
Pre-process the strategy.

Returns:
Whether or not evaluation of the body is necessary.
Throws:
java.io.IOException
TemplateException

processBody

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

Parameters:
block - The block.
output - The output.
model - The model.
Returns:
Whether the body should be evaluated again.
Throws:
java.io.IOException
TemplateException

postProcess

public abstract void postProcess(B block,
                                 TemplateOutput<B> output,
                                 TemplateModel model)
                          throws java.io.IOException,
                                 TemplateException
Post-process the strategy.

Parameters:
block - The block.
output - The output.
model - The model.
Throws:
java.io.IOException
TemplateException

invoke

public void invoke(B block,
                   TemplateOutput<B> output,
                   TemplateModel model)
            throws java.io.IOException,
                   TemplateException
Invoke the strategy using the control process.

Specified by:
invoke in interface TemplateStrategy<B extends TemplateBlock>
Parameters:
block - The block.
output - The output.
model - The model.
Throws:
java.io.IOException
TemplateException