net.sf.jelly.apt.strategies
Class TypeDeclarationLoopStrategy<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<D,B>
              extended by net.sf.jelly.apt.strategies.DeclarationLoopStrategy<D,B>
                  extended by net.sf.jelly.apt.strategies.AnnotationFilterableDeclarationLoopStrategy<com.sun.mirror.declaration.TypeDeclaration,B>
                      extended by net.sf.jelly.apt.strategies.TypeDeclarationLoopStrategy<B>
All Implemented Interfaces:
TemplateStrategy<B>
Direct Known Subclasses:
ImportedTypeDeclarationLoopStrategy, NestedTypeDeclarationLoopStrategy

public class TypeDeclarationLoopStrategy<B extends TemplateBlock>
extends AnnotationFilterableDeclarationLoopStrategy<com.sun.mirror.declaration.TypeDeclaration,B>

Evaluates its body for each type declaration.

If the package is specified, only the top-level classes are returned.

Unless specified otherwise, ClassDeclarations will be included and InterfaceDeclarations will NOT be included.

Author:
Ryan Heaton

Constructor Summary
TypeDeclarationLoopStrategy()
           
 
Method Summary
 java.util.Collection<com.sun.mirror.declaration.TypeDeclaration> getAllDeclarationsToConsiderForAnnotationFiltering()
          The base collection of types over which to iterate.
protected  java.util.Collection<com.sun.mirror.declaration.TypeDeclaration> getAllTypeDeclarations()
          Get all type declarations from the annotation processor environment.
protected  com.sun.mirror.apt.AnnotationProcessorEnvironment getAnnotationProcessorEnvironment()
          The current annotation processor environment.
 com.sun.mirror.declaration.TypeDeclaration getCurrentDeclaration()
          The current declaration in the loop.
protected  com.sun.mirror.declaration.PackageDeclaration getCurrentPackageDeclaration()
          Gets the current declaration (in a loop).
 com.sun.mirror.declaration.PackageDeclaration getPackage()
          The package declaration containing the types.
 boolean isIncludeClasses()
          Whether to include classes in the collection of types over which to iterate.
 boolean isIncludeInterfaces()
          Whether to include interfaces in the collection of types over which to iterate.
 void setIncludeClasses(boolean includeClasses)
          Whether to include classes in the collection of types over which to iterate.
 void setIncludeInterfaces(boolean includeInterfaces)
          Whether to include interfaces in the collection of types over which to iterate.
 void setPackage(com.sun.mirror.declaration.PackageDeclaration pckg)
          The package declaration containing the types.
 
Methods inherited from class net.sf.jelly.apt.strategies.AnnotationFilterableDeclarationLoopStrategy
getAnnotation, getAnnotationVar, getDeclarations, getExcludes, hasAnnotation, setAnnotation, setAnnotationVar, setExcludes, setupModelForLoop
 
Methods inherited from class net.sf.jelly.apt.strategies.DeclarationLoopStrategy
getIndexVar, getLoop, getVar, setIndexVar, setVar
 
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

TypeDeclarationLoopStrategy

public TypeDeclarationLoopStrategy()
Method Detail

getAllDeclarationsToConsiderForAnnotationFiltering

public java.util.Collection<com.sun.mirror.declaration.TypeDeclaration> getAllDeclarationsToConsiderForAnnotationFiltering()
                                                                                                                    throws MissingParameterException
The base collection of types over which to iterate.

Specified by:
getAllDeclarationsToConsiderForAnnotationFiltering in class AnnotationFilterableDeclarationLoopStrategy<com.sun.mirror.declaration.TypeDeclaration,B extends TemplateBlock>
Returns:
The base collection of types over which to iterate.
Throws:
MissingParameterException

getAllTypeDeclarations

protected java.util.Collection<com.sun.mirror.declaration.TypeDeclaration> getAllTypeDeclarations()
                                                                                           throws MissingParameterException
Get all type declarations from the annotation processor environment.

Returns:
All type declarations considered for this loop tag.
Throws:
MissingParameterException

getAnnotationProcessorEnvironment

protected com.sun.mirror.apt.AnnotationProcessorEnvironment getAnnotationProcessorEnvironment()
The current annotation processor environment.

Returns:
The current annotation processor environment.

isIncludeInterfaces

public boolean isIncludeInterfaces()
Whether to include interfaces in the collection of types over which to iterate.

Returns:
Whether to include interfaces in the collection of types over which to iterate.

setIncludeInterfaces

public void setIncludeInterfaces(boolean includeInterfaces)
Whether to include interfaces in the collection of types over which to iterate.

Parameters:
includeInterfaces - Whether to include interfaces in the collection of types over which to iterate.

isIncludeClasses

public boolean isIncludeClasses()
Whether to include classes in the collection of types over which to iterate.

Returns:
Whether to include classes in the collection of types over which to iterate.

setIncludeClasses

public void setIncludeClasses(boolean includeClasses)
Whether to include classes in the collection of types over which to iterate.

Parameters:
includeClasses - Whether to include classes in the collection of types over which to iterate.

getPackage

public com.sun.mirror.declaration.PackageDeclaration getPackage()
The package declaration containing the types.

Returns:
The package declaration containing the types.

setPackage

public void setPackage(com.sun.mirror.declaration.PackageDeclaration pckg)
The package declaration containing the types.

Parameters:
pckg - The package declaration containing the types.

getCurrentDeclaration

public com.sun.mirror.declaration.TypeDeclaration getCurrentDeclaration()
Description copied from class: DeclarationLoopStrategy
The current declaration in the loop.

Overrides:
getCurrentDeclaration in class DeclarationLoopStrategy<com.sun.mirror.declaration.TypeDeclaration,B extends TemplateBlock>
Returns:
The current declaration in the loop.

getCurrentPackageDeclaration

protected com.sun.mirror.declaration.PackageDeclaration getCurrentPackageDeclaration()
Gets the current declaration (in a loop).

Returns:
the current declaration (in a loop).