net.sf.jelly.apt.strategies
Class IfHasDeclarationStrategy<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.IfHasDeclarationStrategy<B>
All Implemented Interfaces:
TemplateStrategy<B>

public class IfHasDeclarationStrategy<B extends TemplateBlock>
extends TemplateBlockStrategy<B>

Evalute the body of the tag if the specified type has a declaration. If the specified type is an array type, the body will not be evaluated.

Author:
Ryan Heaton

Constructor Summary
IfHasDeclarationStrategy()
           
 
Method Summary
 java.lang.String getDeclarationVar()
          The variable to which to assign the declaration variable, if it exists.
 com.sun.mirror.type.TypeMirror getType()
          The type on which to check for a declaration.
 boolean preProcess(B block, TemplateOutput<B> output, TemplateModel model)
          Pushes this strategy on the stack and redirects the output.
 void setDeclarationVar(java.lang.String declarationVar)
          The variable to which to assign the declaration variable, if it exists.
 void setType(com.sun.mirror.type.TypeMirror type)
          The type on which to check for a declaration.
 
Methods inherited from class net.sf.jelly.apt.strategies.TemplateBlockStrategy
postProcess, processBody
 
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

IfHasDeclarationStrategy

public IfHasDeclarationStrategy()
Method Detail

preProcess

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

Overrides:
preProcess in class TemplateBlockStrategy<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

getType

public com.sun.mirror.type.TypeMirror getType()
The type on which to check for a declaration.

Returns:
The type on which to check for a declaration.

setType

public void setType(com.sun.mirror.type.TypeMirror type)
The type on which to check for a declaration.

Parameters:
type - The type on which to check for a declaration.

getDeclarationVar

public java.lang.String getDeclarationVar()
The variable to which to assign the declaration variable, if it exists.

Returns:
The variable to which to assign the declaration variable, if it exists.

setDeclarationVar

public void setDeclarationVar(java.lang.String declarationVar)
The variable to which to assign the declaration variable, if it exists.

Parameters:
declarationVar - The variable to which to assign the declaration variable, if it exists.