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

java.lang.Object
  extended by net.sf.jelly.apt.strategies.TemplateStrategyControl<B>
      extended by net.sf.jelly.apt.strategies.TemplateBlockStrategy<B>
          extended by net.sf.jelly.apt.strategies.TemplateLoopStrategy<com.sun.mirror.type.ReferenceType,B>
              extended by net.sf.jelly.apt.strategies.ThrownTypeLoopStrategy<B>
All Implemented Interfaces:
TemplateStrategy<B>

public class ThrownTypeLoopStrategy<B extends TemplateBlock>
extends TemplateLoopStrategy<com.sun.mirror.type.ReferenceType,B>

Iterates through each thrown type of the specified executable declaration.

Author:
Ryan Heaton

Constructor Summary
ThrownTypeLoopStrategy()
           
 
Method Summary
protected  com.sun.mirror.declaration.ExecutableDeclaration getCurrentExecutableDeclaration()
          Gets the current declaration (in a loop).
 com.sun.mirror.declaration.ExecutableDeclaration getDeclaration()
          The specified declaration.
 java.lang.String getIndexVar()
          Variable in which to store the value of the index.
protected  java.util.Iterator<com.sun.mirror.type.ReferenceType> getLoop(TemplateModel model)
          Get the loop.
protected  java.util.Collection<com.sun.mirror.type.ReferenceType> getThrownTypes()
          Get the thrown types.
 java.lang.String getVar()
          The variable into which to store the current thrown type.
 void setDeclaration(com.sun.mirror.declaration.ExecutableDeclaration declaration)
          The specified declaration.
 void setIndexVar(java.lang.String indexVar)
          Variable in which to store the value of the index.
protected  void setupModelForLoop(TemplateModel model, com.sun.mirror.type.ReferenceType thrownType, int index)
          Sets up the model for the current loop.
 void setVar(java.lang.String var)
          The variable into which to store the current thrown type.
 
Methods inherited from class net.sf.jelly.apt.strategies.TemplateLoopStrategy
preProcess, processBody
 
Methods inherited from class net.sf.jelly.apt.strategies.TemplateBlockStrategy
postProcess
 
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

ThrownTypeLoopStrategy

public ThrownTypeLoopStrategy()
Method Detail

getLoop

protected java.util.Iterator<com.sun.mirror.type.ReferenceType> getLoop(TemplateModel model)
                                                                 throws TemplateException
Description copied from class: TemplateLoopStrategy
Get the loop.

Specified by:
getLoop in class TemplateLoopStrategy<com.sun.mirror.type.ReferenceType,B extends TemplateBlock>
Parameters:
model - The model to use as necessary.
Returns:
The loop.
Throws:
TemplateException

setupModelForLoop

protected void setupModelForLoop(TemplateModel model,
                                 com.sun.mirror.type.ReferenceType thrownType,
                                 int index)
                          throws TemplateException
Description copied from class: TemplateLoopStrategy
Sets up the model for the current loop. Default implementation does nothing.

Overrides:
setupModelForLoop in class TemplateLoopStrategy<com.sun.mirror.type.ReferenceType,B extends TemplateBlock>
Parameters:
model - The model.
thrownType - The loop variable.
index - The loop index.
Throws:
TemplateException

getThrownTypes

protected java.util.Collection<com.sun.mirror.type.ReferenceType> getThrownTypes()
                                                                          throws MissingParameterException
Get the thrown types.

Returns:
The thrown types.
Throws:
MissingParameterException

getVar

public java.lang.String getVar()
The variable into which to store the current thrown type.

Returns:
The variable into which to store the current thrown type.

setVar

public void setVar(java.lang.String var)
The variable into which to store the current thrown type.

Parameters:
var - The variable into which to store the current thrown type.

getIndexVar

public java.lang.String getIndexVar()
Variable in which to store the value of the index.

Returns:
Variable in which to store the value of the index.

setIndexVar

public void setIndexVar(java.lang.String indexVar)
Variable in which to store the value of the index.

Parameters:
indexVar - Variable in which to store the value of the index.

getDeclaration

public com.sun.mirror.declaration.ExecutableDeclaration getDeclaration()
The specified declaration.

Returns:
The specified declaration.

setDeclaration

public void setDeclaration(com.sun.mirror.declaration.ExecutableDeclaration declaration)
The specified declaration.

Parameters:
declaration - The specified declaration.

getCurrentExecutableDeclaration

protected com.sun.mirror.declaration.ExecutableDeclaration getCurrentExecutableDeclaration()
Gets the current declaration (in a loop).

Returns:
the current declaration (in a loop).