org.sandev.generator
Class SQLUpdateProcessorGenerator

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

public class SQLUpdateProcessorGenerator
extends AggregateMappedGeneratorBase
implements org.sandev.sandbuild.SandGenerator

Generate the update processor.


Field Summary
 
Fields inherited from class org.sandev.generator.AggregateMappedGeneratorBase
structmap, structPrefix
 
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
SQLUpdateProcessorGenerator()
           
 
Method Summary
protected  void dumpArrayRewrites(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name, boolean deleteFirst)
          Rewrite the reference arrays.
protected  void dumpParentCall(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name, boolean insert)
          dump a call to insert the parent class information.
protected  java.lang.String getFileSpec(java.io.File baseDir)
          Return "gen_base/src/org/sandev/tools/JDBC/UpdateProcessor.java" or the equivalent filespec for the given platform.
protected  void writeAccessorCall(java.io.PrintStream out, com.sun.javadoc.FieldDoc fd)
           
protected  void writeDoUpdate(java.io.PrintStream out, org.sandev.sandbuild.SandDecl[] decls)
           
protected  void writeFile(java.io.PrintStream out, org.sandev.sandbuild.SandDecl[] decls)
          Write the SchemaVerifier source file
protected  void writeInsert(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
          Write the insert processing.
protected  void writeInsertSQL(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writePostamble(java.io.PrintStream out)
          Write the end of the file.
protected  void writePreamble(java.io.PrintStream out, org.sandev.sandbuild.SandDecl[] decls)
           
protected  int writePreparedStatementSet(java.io.PrintStream out, com.sun.javadoc.FieldDoc[] fields, int currindex)
          write out the prepared statement variable setup starting from the index specified and return the index we ended with.
protected  void writeStatementLog(java.io.PrintStream out, java.lang.String statement, com.sun.javadoc.FieldDoc[] fields)
          Write code to dump out what we are doing to the logfile.
protected  void writeUpdate(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeUpdateProc(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeUpdateSQL(java.io.PrintStream out, com.sun.javadoc.ClassDoc cd, java.lang.String name)
           
protected  void writeUtils(java.io.PrintStream out)
          write the utilities for this class
 
Methods inherited from class org.sandev.generator.AggregateMappedGeneratorBase
getMappedFieldName, getMappedFieldRelation, getMappedFieldRelationChild, getMappedFieldRelationIndex, getMappedFieldRelationParent, getMappedFieldType, getMappedStructName, getMappedStructName, loadStructMapper, loadStructMapper
 
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

SQLUpdateProcessorGenerator

public SQLUpdateProcessorGenerator()
Method Detail

getFileSpec

protected java.lang.String getFileSpec(java.io.File baseDir)
Return "gen_base/src/org/sandev/tools/JDBC/UpdateProcessor.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 SchemaVerifier 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)

writePostamble

protected void writePostamble(java.io.PrintStream out)
Write the end of the file.


writeDoUpdate

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

writeUpdateProc

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

writeInsertSQL

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

writeInsert

protected void writeInsert(java.io.PrintStream out,
                           com.sun.javadoc.ClassDoc cd,
                           java.lang.String name)
Write the insert processing. This dumps a call to its parent, which in turn will call its parent as necessary, on up the inheritance hierarchy.


dumpParentCall

protected void dumpParentCall(java.io.PrintStream out,
                              com.sun.javadoc.ClassDoc cd,
                              java.lang.String name,
                              boolean insert)
dump a call to insert the parent class information.


writePreparedStatementSet

protected int writePreparedStatementSet(java.io.PrintStream out,
                                        com.sun.javadoc.FieldDoc[] fields,
                                        int currindex)
write out the prepared statement variable setup starting from the index specified and return the index we ended with.


writeAccessorCall

protected void writeAccessorCall(java.io.PrintStream out,
                                 com.sun.javadoc.FieldDoc fd)

writeStatementLog

protected void writeStatementLog(java.io.PrintStream out,
                                 java.lang.String statement,
                                 com.sun.javadoc.FieldDoc[] fields)
Write code to dump out what we are doing to the logfile.


dumpArrayRewrites

protected void dumpArrayRewrites(java.io.PrintStream out,
                                 com.sun.javadoc.ClassDoc cd,
                                 java.lang.String name,
                                 boolean deleteFirst)
Rewrite the reference arrays. Delete if necessary, then insert. This is only for the reference arrays in this class, inherited arrays are handled by the parent unless the parent is abstract.


writeUpdateSQL

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

writeUpdate

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

writeUtils

protected void writeUtils(java.io.PrintStream out)
write the utilities for this class