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

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

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

Writes a value to template output.

Author:
Ryan Heaton

Constructor Summary
TemplateValueStrategy()
           
 
Method Summary
protected abstract  java.lang.String getValue()
          Get the value to write to the template output.
 void postProcess(B block, TemplateOutput<B> output, TemplateModel model)
          Do nothing.
 boolean preProcess(B block, TemplateOutput<B> output, TemplateModel model)
          Writes the value to the output.
 boolean processBody(B block, TemplateOutput<B> output, TemplateModel model)
          Process the body of the block.
 
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

TemplateValueStrategy

public TemplateValueStrategy()
Method Detail

getValue

protected abstract java.lang.String getValue()
                                      throws TemplateException
Get the value to write to the template output.

Returns:
The value to write to the template output.
Throws:
TemplateException

preProcess

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

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

processBody

public boolean processBody(B block,
                           TemplateOutput<B> output,
                           TemplateModel model)
                    throws java.io.IOException,
                           TemplateException
Description copied from class: TemplateStrategyControl
Process the body of the block.

Specified by:
processBody in class TemplateStrategyControl<B extends TemplateBlock>
Parameters:
block - The block.
output - The output.
model - The model.
Returns:
Whether the body should be evaluated again.
Throws:
java.lang.UnsupportedOperationException - Because a value strategy shouldn't have a body.
java.io.IOException
TemplateException

postProcess

public void postProcess(B block,
                        TemplateOutput<B> output,
                        TemplateModel model)
                 throws java.io.IOException,
                        TemplateException
Do nothing.

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