org.locomotive.module.codegen
Class CodeGeneratorServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.locomotive.loco.servlet.LocoServlet
                    |
                    +--org.locomotive.module.codegen.CodeGeneratorServlet

public class CodeGeneratorServlet
extends LocoServlet

CodeGenerator is a Java program which generates source code for other Java programs. CodeGenerator can read a class declaration from an HTML Form field, and fill in some Steam variables which allow the template java_class.tmpl to fill in many details of a full LocoServlet class. The format of the class declaration should look like:

 public class MyClass
 {
     String str;
 }
 
CodeGenerator will create a primary identifier field, called "id", and make it the first field. This field will be this class's PRIMARY KEY in the database.

See Also:
Serialized Form

Fields inherited from class org.locomotive.loco.servlet.LocoServlet
conn, DEBUG, ERROR, form_data, NORMAL, req, resp, session, steam_vars, url_tokens, user, WARNING
 
Constructor Summary
CodeGeneratorServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
static void main(java.lang.String[] argv)
          To be implemented in the future: read a class definition from the standard input and generate a Java class and HTML form on the output.
protected  java.lang.String parseClassDefinition(java.lang.String class_definition)
           
 
Methods inherited from class org.locomotive.loco.servlet.LocoServlet
displayPage, displayString, handleException, log, logEvent, sayBadURL, service, setup
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeGeneratorServlet

public CodeGeneratorServlet()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse resp)
           throws javax.servlet.ServletException,
                  java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse resp)
            throws javax.servlet.ServletException,
                   java.io.IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet

main

public static void main(java.lang.String[] argv)
To be implemented in the future: read a class definition from the standard input and generate a Java class and HTML form on the output.

parseClassDefinition

protected java.lang.String parseClassDefinition(java.lang.String class_definition)
                                         throws javax.servlet.ServletException,
                                                java.io.IOException