net.sf.jelly.apt.strategies
Class MemberDeclarationLoopStrategy<M extends com.sun.mirror.declaration.MemberDeclaration,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<M,B>
                      extended by net.sf.jelly.apt.strategies.MemberDeclarationLoopStrategy<M,B>
All Implemented Interfaces:
TemplateStrategy<B>
Direct Known Subclasses:
ExecutableDeclarationLoopStrategy, FieldDeclarationLoopStrategy, PropertyDeclarationLoopStrategy

public abstract class MemberDeclarationLoopStrategy<M extends com.sun.mirror.declaration.MemberDeclaration,B extends TemplateBlock>
extends AnnotationFilterableDeclarationLoopStrategy<M,B>

Loop tag through a collection of MemberDeclarations. Options are available to include the superclasses and superinterfaces. By default, the members of superclasses and superinterfaces will not be included in the loop.

Author:
Ryan Heaton

Constructor Summary
MemberDeclarationLoopStrategy()
           
 
Method Summary
 java.util.Collection<M> getAllDeclarationsToConsiderForAnnotationFiltering()
          Get the list of all declarations to consider.
protected  com.sun.mirror.apt.AnnotationProcessorEnvironment getAnnotationProcessorEnvironment()
          The current annotation processing environment.
protected  com.sun.mirror.declaration.TypeDeclaration getCurrentTypeDeclaration()
          Gets the current declaration (in a loop).
 com.sun.mirror.declaration.TypeDeclaration getDeclaration()
          The specified declaration.
protected abstract  java.util.Collection<M> getMemberDeclarations(com.sun.mirror.declaration.TypeDeclaration declaration)
          Get the desired member declarations of a given declaration.
protected  java.util.Collection<M> getSuperclassesMemberDeclarations(com.sun.mirror.declaration.ClassDeclaration type)
          Get the member declarations for all superclasses of type.
protected  java.util.Collection<M> getSuperinterfacesMemberDeclarations(com.sun.mirror.declaration.TypeDeclaration type)
          Get the member declarations for all superinterfaces of type.
protected  boolean hidden(M declaration, java.util.ArrayList<M> declarations)
          Determines whether a declaration is hidden by any declaration in the given list.
 boolean isIncludeSuperclasses()
          Whether to include superclasses.
 boolean isIncludeSuperinterfaces()
          Whether to include superinterfaces.
 void setDeclaration(com.sun.mirror.declaration.TypeDeclaration declaration)
          The specified declaration.
 void setIncludeSuperclasses(boolean includeSuperclasses)
          Whether to include superclasses.
 void setIncludeSuperinterfaces(boolean includeSuperinterfaces)
          Whether to include superinterfaces.
 
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
getCurrentDeclaration, 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

MemberDeclarationLoopStrategy

public MemberDeclarationLoopStrategy()
Method Detail

getAllDeclarationsToConsiderForAnnotationFiltering

public java.util.Collection<M> getAllDeclarationsToConsiderForAnnotationFiltering()
                                                                                                                                throws MissingParameterException
Description copied from class: AnnotationFilterableDeclarationLoopStrategy
Get the list of all declarations to consider.

Specified by:
getAllDeclarationsToConsiderForAnnotationFiltering in class AnnotationFilterableDeclarationLoopStrategy<M extends com.sun.mirror.declaration.MemberDeclaration,B extends TemplateBlock>
Returns:
The list of all declarations to consider.
Throws:
MissingParameterException

hidden

protected boolean hidden(M declaration,
                         java.util.ArrayList<M> declarations)
Determines whether a declaration is hidden by any declaration in the given list.

Parameters:
declaration - The declaration.
declarations - The declaration list.
Returns:
Whether a declaration is hidden by any declaration in the given list.

getAnnotationProcessorEnvironment

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

Returns:
The current annotation processing environment.

getSuperclassesMemberDeclarations

protected java.util.Collection<M> getSuperclassesMemberDeclarations(com.sun.mirror.declaration.ClassDeclaration type)
                                                                                                                  throws MissingParameterException
Get the member declarations for all superclasses of type.

Parameters:
type - The class declaration for which to get the member declarations of all superclasses.
Returns:
The member declarations.
Throws:
MissingParameterException

getSuperinterfacesMemberDeclarations

protected java.util.Collection<M> getSuperinterfacesMemberDeclarations(com.sun.mirror.declaration.TypeDeclaration type)
                                                                                                                     throws MissingParameterException
Get the member declarations for all superinterfaces of type.

Parameters:
type - The class declaration for which to get the member declarations of all superinterfaces.
Returns:
The member declarations.
Throws:
MissingParameterException

getMemberDeclarations

protected abstract java.util.Collection<M> getMemberDeclarations(com.sun.mirror.declaration.TypeDeclaration declaration)
                                                                                                               throws MissingParameterException
Get the desired member declarations of a given declaration.

Parameters:
declaration - The declaration.
Returns:
the desired member declarations of a given declaration.
Throws:
MissingParameterException

isIncludeSuperclasses

public boolean isIncludeSuperclasses()
Whether to include superclasses.

Returns:
Whether to include superclasses.

setIncludeSuperclasses

public void setIncludeSuperclasses(boolean includeSuperclasses)
Whether to include superclasses.

Parameters:
includeSuperclasses - Whether to include superclasses.

isIncludeSuperinterfaces

public boolean isIncludeSuperinterfaces()
Whether to include superinterfaces.

Returns:
Whether to include superinterfaces.

setIncludeSuperinterfaces

public void setIncludeSuperinterfaces(boolean includeSuperinterfaces)
Whether to include superinterfaces.

Parameters:
includeSuperinterfaces - Whether to include superinterfaces.

getDeclaration

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

Returns:
The specified declaration.

setDeclaration

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

Parameters:
declaration - The specified declaration.

getCurrentTypeDeclaration

protected com.sun.mirror.declaration.TypeDeclaration getCurrentTypeDeclaration()
Gets the current declaration (in a loop).

Returns:
the current declaration (in a loop).