|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sandev.generator.GeneratorCommon
org.sandev.generator.FuncSpecGenerator
public class FuncSpecGenerator
Write out a functional specification website off the driving project
docs area. This generator is run from the deployment project build
(eg deploy/xyzmain) with the primary source project (eg apps/xyz)
specified in the extra parameter of the sandgenerator
build declaration. Output is to the docs/funcspec area of the
deployment project.
Note that any supporting images or documents will have to be copied into the funcspec directory separately as part of the build script for the deployment. This generator doesn't traverse links yet.
The functional specification is built from:
Finding TaskHeapData.html off the deployment allows for flexibility when managing multiple deployments of the same app. However if no TaskHeapData.html file is found off the deployment, then we look for it off the driving application.
| Field Summary | |
|---|---|
protected static int |
ALLSTRUCTS
|
static java.lang.String |
helpDeploy
|
static java.lang.String |
helpObjective
|
static java.lang.String |
helpTaskHeap
|
static java.lang.String |
helpUIReqs
|
static java.lang.String |
helpUserStories
|
protected static int |
PERSISTSTRUCTS
|
protected static int |
RUNTIMESTRUCTS
|
| Fields inherited from class org.sandev.generator.GeneratorCommon |
|---|
CONTEXT_CONFIGURATION, CONTEXT_CONTROL, CONTEXT_FRAMEWORK, CONTEXT_MESSAGING, CONTEXT_PERSISTENCE, CONTEXT_UI, DEFAULT_LINE_LENGTH, MESSAGE_INTERFACES |
| Constructor Summary | |
|---|---|
FuncSpecGenerator()
|
|
| Method Summary | |
|---|---|
protected static boolean |
attachToTree(org.sandev.sandbuild.SandDeclTreeWrapper root,
org.sandev.sandbuild.SandDeclTreeWrapper orphan)
Find the parent of the orphan and hook it up. |
void |
cleanup(org.sandev.sandbuild.SandDecl[] decls,
java.io.File baseDir,
boolean changed,
java.lang.String extra)
Clean up the files we wrote. |
protected void |
dumpGeneratedComments(java.io.PrintStream out,
com.sun.javadoc.FieldDoc fd,
java.lang.String indent)
Dump out any additional generated comments for this field. |
protected java.lang.String |
filterHTMLLine(java.lang.String line)
If the given line contains a node documentation link to be substituted then make that happen. |
void |
generate(org.sandev.sandbuild.SandDecl[] decls,
java.io.File baseDir,
boolean changed,
java.util.Collection dirtyFiles,
java.lang.String extra)
Create the functional specification website files. |
static org.sandev.sandbuild.SandDeclTreeWrapper |
getAppStructDecls(org.sandev.sandbuild.SandDecl[] decls,
java.lang.String srcPrefix)
Given an array of declarations, return all the struct declarations for the app, as identified by the source prefix. |
protected java.lang.String |
getFieldNameText(com.sun.javadoc.FieldDoc fd)
Return the display text for this field |
java.lang.String |
getFirstHTMLSentence(java.lang.String filespec)
Return the first sentence from the body of the given HTML file. |
static boolean |
structsChanged(org.sandev.sandbuild.SandDeclTreeWrapper root)
Return true if any of the declarations in the tree have changed, false otherwise. |
protected void |
verifyDeploy(java.lang.String depdocs,
java.lang.String specdir,
boolean changed,
java.lang.String switches)
Write the deployment document. |
protected static boolean |
verifyHierarchy(org.sandev.sandbuild.SandDeclTreeWrapper root,
org.sandev.sandbuild.SandDecl[] decls)
Return false, and fix the failing reference, if at any point a recursive depth first traversal of the hierarchy shows the tree is not correct. |
protected void |
verifyIndex(java.lang.String appdocs,
java.lang.String depdocs,
java.lang.String specdir,
java.lang.String depname,
boolean changed)
Write the index file for the func specs. |
protected void |
writeBannerFrame(java.lang.String specdir,
java.lang.String obfilename)
Write out the contents of the banner frame. |
protected void |
writeDeclTree(java.io.PrintStream out,
org.sandev.sandbuild.SandDeclTreeWrapper root,
java.lang.String prefix,
int includeMode)
Write out the given SandDeclTreeWrapper, recursing into each child as necessary. |
protected void |
writeIndexFile(java.lang.String indexfilename,
java.lang.String obfilename,
java.lang.String genlinkfilename,
java.lang.String depname)
Write out the main index file frameset. |
protected void |
writeIndexTOC(java.io.PrintStream out,
java.lang.String genlinkfilename,
java.lang.String obfilename)
Write the links for the func specs. |
protected void |
writeNavFrame(java.lang.String specdir,
java.lang.String obfilename,
java.lang.String genlinkfilename,
java.lang.String depname)
Write out the contents of the navigation frame. |
protected void |
writeNodeDescription(java.io.PrintStream out,
com.sun.javadoc.ClassDoc cd)
Write out a description of the node declaration. |
protected void |
writeNodeDoc(org.sandev.sandbuild.SandDecl[] decls,
java.lang.String specdir,
boolean changed,
java.lang.String switches)
Walk through the decls, grabbing the nodes and writing out a doc describing them. |
protected void |
writeStructDecl(java.io.PrintStream out,
com.sun.javadoc.ClassDoc cd)
Write out a description of the struct declaration. |
protected void |
writeStructDetails(java.io.PrintStream out,
org.sandev.sandbuild.SandDeclTreeWrapper root)
Write out a descriptive page for each struct declaration. |
protected void |
writeStructDoc(org.sandev.sandbuild.SandDecl[] decls,
java.lang.String appdocs,
java.lang.String specdir,
boolean changed,
java.lang.String switches)
Walk through the decls, grabbing only those structs whose src is adjacent to the appdocs area. |
protected void |
writeStructFile(java.lang.String filename,
org.sandev.sandbuild.SandDeclTreeWrapper root,
java.lang.String switches)
Write out a file with the struct declarations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String helpObjective
public static final java.lang.String helpUserStories
public static final java.lang.String helpUIReqs
public static final java.lang.String helpDeploy
public static final java.lang.String helpTaskHeap
protected static final int ALLSTRUCTS
protected static final int PERSISTSTRUCTS
protected static final int RUNTIMESTRUCTS
| Constructor Detail |
|---|
public FuncSpecGenerator()
| Method Detail |
|---|
public void generate(org.sandev.sandbuild.SandDecl[] decls,
java.io.File baseDir,
boolean changed,
java.util.Collection dirtyFiles,
java.lang.String extra)
throws org.sandev.sandbuild.SandGeneratorException
../docs/funcspec/index.html and copies
supporting files over as needed.
generate in interface org.sandev.sandbuild.SandGeneratororg.sandev.sandbuild.SandGeneratorException
public void cleanup(org.sandev.sandbuild.SandDecl[] decls,
java.io.File baseDir,
boolean changed,
java.lang.String extra)
throws org.sandev.sandbuild.SandGeneratorException
cleanup in interface org.sandev.sandbuild.SandGeneratororg.sandev.sandbuild.SandGeneratorException
protected void verifyIndex(java.lang.String appdocs,
java.lang.String depdocs,
java.lang.String specdir,
java.lang.String depname,
boolean changed)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeIndexFile(java.lang.String indexfilename,
java.lang.String obfilename,
java.lang.String genlinkfilename,
java.lang.String depname)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeBannerFrame(java.lang.String specdir,
java.lang.String obfilename)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeNavFrame(java.lang.String specdir,
java.lang.String obfilename,
java.lang.String genlinkfilename,
java.lang.String depname)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeIndexTOC(java.io.PrintStream out,
java.lang.String genlinkfilename,
java.lang.String obfilename)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
public java.lang.String getFirstHTMLSentence(java.lang.String filespec)
throws org.sandev.sandbuild.SandGeneratorException
body tag start, then searches
forward to the next ". ", then reads backward to the first tag
close and returns that as the result string.
org.sandev.sandbuild.SandGeneratorException
public static org.sandev.sandbuild.SandDeclTreeWrapper getAppStructDecls(org.sandev.sandbuild.SandDecl[] decls,
java.lang.String srcPrefix)
throws org.sandev.sandbuild.SandGeneratorException
This works by walking the declarations and rejecting any that are not structs, or whose file specification does not start with the given source prefix. After finding the app structs, this walks the inheritence tree upwards to bring in any other structs from other applications that were extended within this app.
org.sandev.sandbuild.SandGeneratorException
protected static boolean verifyHierarchy(org.sandev.sandbuild.SandDeclTreeWrapper root,
org.sandev.sandbuild.SandDecl[] decls)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected static boolean attachToTree(org.sandev.sandbuild.SandDeclTreeWrapper root,
org.sandev.sandbuild.SandDeclTreeWrapper orphan)
public static boolean structsChanged(org.sandev.sandbuild.SandDeclTreeWrapper root)
protected void writeStructDoc(org.sandev.sandbuild.SandDecl[] decls,
java.lang.String appdocs,
java.lang.String specdir,
boolean changed,
java.lang.String switches)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeStructFile(java.lang.String filename,
org.sandev.sandbuild.SandDeclTreeWrapper root,
java.lang.String switches)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeDeclTree(java.io.PrintStream out,
org.sandev.sandbuild.SandDeclTreeWrapper root,
java.lang.String prefix,
int includeMode)
protected void writeStructDetails(java.io.PrintStream out,
org.sandev.sandbuild.SandDeclTreeWrapper root)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeStructDecl(java.io.PrintStream out,
com.sun.javadoc.ClassDoc cd)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorExceptionprotected java.lang.String getFieldNameText(com.sun.javadoc.FieldDoc fd)
protected void dumpGeneratedComments(java.io.PrintStream out,
com.sun.javadoc.FieldDoc fd,
java.lang.String indent)
protected void writeNodeDoc(org.sandev.sandbuild.SandDecl[] decls,
java.lang.String specdir,
boolean changed,
java.lang.String switches)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void writeNodeDescription(java.io.PrintStream out,
com.sun.javadoc.ClassDoc cd)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorException
protected void verifyDeploy(java.lang.String depdocs,
java.lang.String specdir,
boolean changed,
java.lang.String switches)
throws org.sandev.sandbuild.SandGeneratorException
org.sandev.sandbuild.SandGeneratorExceptionprotected java.lang.String filterHTMLLine(java.lang.String line)
$NODEDOC(TaskHeapUI).
filterHTMLLine in class GeneratorCommon
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||