org.sandev.generator
Class XHTMLFormGenerator

java.lang.Object
  extended by org.sandev.generator.GeneratorCommon
      extended by org.sandev.generator.AggregateGeneratorBase
          extended by org.sandev.generator.XHTMLFormGenerator
All Implemented Interfaces:
org.sandev.sandbuild.SandGenerator

public class XHTMLFormGenerator
extends org.sandev.generator.AggregateGeneratorBase
implements org.sandev.sandbuild.SandGenerator

Write the XHTMLFormAdaptor source file


Field Summary
 
Fields inherited from class org.sandev.generator.AggregateGeneratorBase
extra
 
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
XHTMLFormGenerator()
           
 
Method Summary
protected  void dumpFormattingAttrVals(java.io.PrintStream out, java.lang.String prefix, com.sun.javadoc.FieldDoc fd, org.sandev.generator.tags.StructTagFieldlayout stfl)
          Write out the relevant field level formatting directives as an array of SandAttrVals.
protected  void dumpPrefix(java.io.PrintStream out, boolean commaNeeded, java.lang.String prefix)
          Dump out the prefix line start.
protected  void dumpTabIndex(java.io.PrintStream out, java.lang.String prefix, com.sun.javadoc.FieldDoc fd, org.sandev.generator.tags.StructTagFieldlayout stfl)
          Write out the relevant tabindex declaration for the field.
protected  java.lang.String getFileSpec(java.io.File baseDir)
          Return "gen_base/src/org/sandev/tools/HTTP/pre_XHTMLFormAdaptor.java" or the equivalent filespec for the given platform.
protected  void writeCollDump(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeCollLoad(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeDumpMessage(java.io.PrintStream out, org.sandev.sandbuild.SandDecl[] decls)
           
protected  void writeFile(java.io.PrintStream out, org.sandev.sandbuild.SandDecl[] decls)
          Write the XHTMLFormAdaptor source file
protected  void writeLoadMessage(java.io.PrintStream out, org.sandev.sandbuild.SandDecl[] decls)
           
protected  void writeMessageDump(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
          Write the code to dump this message out.
protected  void writeMessageHandlers(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeMessageHandlers(java.io.PrintStream out, org.sandev.sandbuild.SandDecl[] decls)
           
protected  void writeMessageLoad(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeNewStructMessage(java.io.PrintStream out, org.sandev.sandbuild.SandDecl[] decls)
           
protected  void writePostamble(java.io.PrintStream out)
           
protected  void writePreamble(java.io.PrintStream out, org.sandev.sandbuild.SandDecl[] decls)
           
protected  void writeQueryDump(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeQueryLoad(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeTreeMessageDump(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
          Write the code to dump out a tree message.
protected  void writeUpdateDump(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeUpdateLoad(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
 
Methods inherited from class org.sandev.generator.AggregateGeneratorBase
addSandAttrValToDecls, cleanup, cleanupSecondaryFiles, generate, getExtra, setExtra, writeSecondaryFiles
 
Methods inherited from class org.sandev.generator.GeneratorCommon
capitalize, copyfile, deletefile, filterHTMLLine, findStructDeclByShortname, getDeclaredFields, getFields, getInheritanceHierarchy, getLastAppProject, getLastUtilDir, getLongInstanceName, getPrintStream, getSandProject, getShortInstanceName, getUtilPackage, getVisibleFields, hasSubStructs, isArray, isBasic, isLongReferenceArray, isMessageInterface, isParentAbstract, isPrimitive, isRootStruct, isVowel, log, nextToken, pluralize, rangeEscape, removePlatformDecls, trackFileDelete, trackFileWrite, uncapitalize, writeDefaultCtor, writeDescription, writeHTMLContents, writeMessageImports, writeSectionName, writeStandardCommentID, writeXHTMLFooter, writeXHTMLFooter, writeXHTMLHeader, writeXHTMLHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sandev.sandbuild.SandGenerator
cleanup, generate
 

Constructor Detail

XHTMLFormGenerator

public XHTMLFormGenerator()
Method Detail

getFileSpec

protected java.lang.String getFileSpec(java.io.File baseDir)
Return "gen_base/src/org/sandev/tools/HTTP/pre_XHTMLFormAdaptor.java" or the equivalent filespec for the given platform.

Overrides:
getFileSpec in class org.sandev.generator.AggregateGeneratorBase

writeFile

protected void writeFile(java.io.PrintStream out,
                         org.sandev.sandbuild.SandDecl[] decls)
                  throws org.sandev.sandbuild.SandGeneratorException
Write the XHTMLFormAdaptor source file

Overrides:
writeFile in class org.sandev.generator.AggregateGeneratorBase
Throws:
org.sandev.sandbuild.SandGeneratorException

writePreamble

protected void writePreamble(java.io.PrintStream out,
                             org.sandev.sandbuild.SandDecl[] decls)
                      throws org.sandev.sandbuild.SandGeneratorException
Throws:
org.sandev.sandbuild.SandGeneratorException

writePostamble

protected void writePostamble(java.io.PrintStream out)

writeNewStructMessage

protected void writeNewStructMessage(java.io.PrintStream out,
                                     org.sandev.sandbuild.SandDecl[] decls)

writeLoadMessage

protected void writeLoadMessage(java.io.PrintStream out,
                                org.sandev.sandbuild.SandDecl[] decls)

writeDumpMessage

protected void writeDumpMessage(java.io.PrintStream out,
                                org.sandev.sandbuild.SandDecl[] decls)

writeMessageHandlers

protected void writeMessageHandlers(java.io.PrintStream out,
                                    org.sandev.sandbuild.SandDecl[] decls)

writeMessageHandlers

protected void writeMessageHandlers(java.io.PrintStream out,
                                    com.sun.javadoc.ClassDoc cd,
                                    java.lang.String name)

writeQueryDump

protected void writeQueryDump(java.io.PrintStream out,
                              com.sun.javadoc.ClassDoc cd,
                              java.lang.String name)

writeQueryLoad

protected void writeQueryLoad(java.io.PrintStream out,
                              com.sun.javadoc.ClassDoc cd,
                              java.lang.String name)

writeCollDump

protected void writeCollDump(java.io.PrintStream out,
                             com.sun.javadoc.ClassDoc cd,
                             java.lang.String name)

writeCollLoad

protected void writeCollLoad(java.io.PrintStream out,
                             com.sun.javadoc.ClassDoc cd,
                             java.lang.String name)

writeUpdateDump

protected void writeUpdateDump(java.io.PrintStream out,
                               com.sun.javadoc.ClassDoc cd,
                               java.lang.String name)

writeUpdateLoad

protected void writeUpdateLoad(java.io.PrintStream out,
                               com.sun.javadoc.ClassDoc cd,
                               java.lang.String name)

writeTreeMessageDump

protected void writeTreeMessageDump(java.io.PrintStream out,
                                    com.sun.javadoc.ClassDoc cd,
                                    java.lang.String name)
Write the code to dump out a tree message.


writeMessageDump

protected void writeMessageDump(java.io.PrintStream out,
                                com.sun.javadoc.ClassDoc cd,
                                java.lang.String name)
Write the code to dump this message out. This is a very large decision tree branching off
  1. the dumpmode,
  2. whether the field is an array or not,
  3. the type of the field,
  4. the field tags.
The method itself is quite long and heavily indented, but it shows the entire tree. When the method was factored out into multiple smaller methods, the tree became more difficult to maintain because it was harder to find the matching cases to apply a tag, and things got buggy due to missing some cases when adding new functionality. So this is now back to being one big method where the entire effect of a field tag modification can be seen.


writeMessageLoad

protected void writeMessageLoad(java.io.PrintStream out,
                                com.sun.javadoc.ClassDoc cd,
                                java.lang.String name)

dumpFormattingAttrVals

protected void dumpFormattingAttrVals(java.io.PrintStream out,
                                      java.lang.String prefix,
                                      com.sun.javadoc.FieldDoc fd,
                                      org.sandev.generator.tags.StructTagFieldlayout stfl)
Write out the relevant field level formatting directives as an array of SandAttrVals. The array can be passed along to standardized dump methods to be included as hidden values within a span.


dumpTabIndex

protected void dumpTabIndex(java.io.PrintStream out,
                            java.lang.String prefix,
                            com.sun.javadoc.FieldDoc fd,
                            org.sandev.generator.tags.StructTagFieldlayout stfl)
Write out the relevant tabindex declaration for the field. Inits to -1 if not defined in the layout.


dumpPrefix

protected void dumpPrefix(java.io.PrintStream out,
                          boolean commaNeeded,
                          java.lang.String prefix)
Dump out the prefix line start. If a comma is needed, then flush existing output with a comma first.