org.sandev.generator
Class GenDriverDoclet

java.lang.Object
  extended byorg.sandev.generator.GenDriverDoclet

public class GenDriverDoclet
extends java.lang.Object

Bridge between the SAND build, the doclet API, and the SandGenerator API. We access the SandBuildDriver for what needs to be done, and provide the ClassDocs to each of the generators.

Notes:


Constructor Summary
GenDriverDoclet()
           
 
Method Summary
protected static void callGenerator(org.sandev.sandbuild.SandGenDecl sgd, org.sandev.sandbuild.SandDecl[] decls, org.sandev.sandbuild.SandProject proj, org.sandev.sandbuild.SandBuildDriver sbd)
          Call the build method of the given generator, with the given array of declarations.
static void dumpClassDocs(com.sun.javadoc.ClassDoc[] classes)
          Dump out the given ClassDocs for debug purposes.
protected static void runGenerator(org.sandev.sandbuild.SandGenDecl sgd, org.sandev.sandbuild.SandProject proj, org.sandev.sandbuild.SandBuildDriver sbd)
          Call the given generator
static void runGenerators(org.sandev.sandbuild.SandBuildDriver sbd, org.sandev.sandbuild.SandProject proj)
          Walk the global collection of generators, calling all those with with global runscope or local runscope matching the current project.
static void setUpClassDocs(org.sandev.sandbuild.SandBuildDriver sbd, com.sun.javadoc.ClassDoc[] classes)
          Init the ClassDoc references for all the SandDecls held in SandBuildDriver.
static boolean start(com.sun.javadoc.RootDoc root)
          Doclet entry point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenDriverDoclet

public GenDriverDoclet()
Method Detail

start

public static boolean start(com.sun.javadoc.RootDoc root)
Doclet entry point.


setUpClassDocs

public static void setUpClassDocs(org.sandev.sandbuild.SandBuildDriver sbd,
                                  com.sun.javadoc.ClassDoc[] classes)
                           throws org.sandev.sandbuild.SandBuildException
Init the ClassDoc references for all the SandDecls held in SandBuildDriver. Basically we walk the classes, find the associated SandDecl using the qualified name.

The smart way is to sort the classes and the SandDecls on the qualified name first, then walk both lists in order. That's 2x NlgN + N so 3N2lgN which is NlgN. Doing it via linear lookup each time is Nsquared. Given that N is relatively small and there is other overhead (including allocations) for sorting, I'm not sure how much this really matters. So doing this simplistic way for now.

Throws:
org.sandev.sandbuild.SandBuildException

dumpClassDocs

public static void dumpClassDocs(com.sun.javadoc.ClassDoc[] classes)
Dump out the given ClassDocs for debug purposes.


runGenerators

public static void runGenerators(org.sandev.sandbuild.SandBuildDriver sbd,
                                 org.sandev.sandbuild.SandProject proj)
                          throws org.sandev.sandbuild.SandBuildException
Walk the global collection of generators, calling all those with with global runscope or local runscope matching the current project. Repeat for all downstream projects.

Throws:
org.sandev.sandbuild.SandBuildException

runGenerator

protected static void runGenerator(org.sandev.sandbuild.SandGenDecl sgd,
                                   org.sandev.sandbuild.SandProject proj,
                                   org.sandev.sandbuild.SandBuildDriver sbd)
                            throws org.sandev.sandbuild.SandBuildException
Call the given generator

Throws:
org.sandev.sandbuild.SandBuildException

callGenerator

protected static void callGenerator(org.sandev.sandbuild.SandGenDecl sgd,
                                    org.sandev.sandbuild.SandDecl[] decls,
                                    org.sandev.sandbuild.SandProject proj,
                                    org.sandev.sandbuild.SandBuildDriver sbd)
                             throws org.sandev.sandbuild.SandBuildException
Call the build method of the given generator, with the given array of declarations.

Throws:
org.sandev.sandbuild.SandBuildException