com.objectwave.sourceGenerator
Class SourceCodeGenerator

java.lang.Object
  |
  +--com.objectwave.sourceGenerator.SourceCodeGenerator
All Implemented Interfaces:
java.io.Serializable

public class SourceCodeGenerator
extends java.lang.Object
implements java.io.Serializable

This class does very little but house some common source generation routines. These routines are shared by the various other generating utilities.

Version:
$Id: SourceCodeGenerator.java,v 2.0 2001/06/11 15:54:25 dave_hoag Exp $
Author:
dhoag
See Also:
Serialized Form

Field Summary
static MergeTemplate useThisTemplate
           
 
Constructor Summary
SourceCodeGenerator()
           
 
Method Summary
static void addClassElement(ClassElement meth, java.util.Vector v, boolean overwrite)
          Generic source generation routine used by various SourceCodeGenerators.
 java.lang.String createClass(ClassInformation ci, java.lang.String path)
          This should probably be removed from this class.
 MergeTemplate getTemplate()
          Generic method for getting the source code template to Generate an entire class.
static void insertClassElement(ClassElement meth, java.util.Vector v, boolean overwrite)
          Generic source generation routine used by various SourceCodeGenerators.
static void main(java.lang.String[] args)
          args[0] TemplateName args[1] TemplateFile args[2] SourceFile
static void removeClassElement(ClassElement meth, java.util.Vector v)
          Remove the element in Vector v that is equal() to the param meth.
static void setGenerationTemplate(MergeTemplate aTemplate)
          Template used for generating a new class.
static void writeClassElements(ClassElement[] elements, java.lang.String fName)
          Write the class elements to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useThisTemplate

public static MergeTemplate useThisTemplate
Constructor Detail

SourceCodeGenerator

public SourceCodeGenerator()
Method Detail

setGenerationTemplate

public static void setGenerationTemplate(MergeTemplate aTemplate)
Template used for generating a new class. This should probably be remove from this class.

Parameters:
aTemplate - The new GenerationTemplate value

addClassElement

public static void addClassElement(ClassElement meth,
                                   java.util.Vector v,
                                   boolean overwrite)
Generic source generation routine used by various SourceCodeGenerators. Add the ClassElement meth into the Vector v. This may replace any existing element (depending on the value of the boolean parameter) or just add to end if an equal ClassElement is not already found.

Parameters:
meth - The feature to be added to the ClassElement attribute
v - The feature to be added to the ClassElement attribute
overwrite - The feature to be added to the ClassElement attribute
See Also:
insertClassElement(com.objectwave.sourceModel.ClassElement, java.util.Vector, boolean)

insertClassElement

public static void insertClassElement(ClassElement meth,
                                      java.util.Vector v,
                                      boolean overwrite)
Generic source generation routine used by various SourceCodeGenerators. Insert the ClassElement meth into the Vector v. This may replace any existing element (depending on the value of the boolean parameter) or just insert to front if an equal ClassElement is not already found.

Parameters:
meth -
v -
overwrite -
See Also:
addClassElement(com.objectwave.sourceModel.ClassElement, java.util.Vector, boolean)

removeClassElement

public static void removeClassElement(ClassElement meth,
                                      java.util.Vector v)
Remove the element in Vector v that is equal() to the param meth.

Parameters:
meth -
v -

writeClassElements

public static void writeClassElements(ClassElement[] elements,
                                      java.lang.String fName)
                               throws java.io.IOException
Write the class elements to a file.

Parameters:
elements -
fName -
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
args[0] TemplateName args[1] TemplateFile args[2] SourceFile

Parameters:
args - The command line arguments

getTemplate

public MergeTemplate getTemplate()
                          throws java.io.IOException
Generic method for getting the source code template to Generate an entire class. This should probably be removed from this class.

Returns:
The Template value
Throws:
java.io.IOException

createClass

public java.lang.String createClass(ClassInformation ci,
                                    java.lang.String path)
                             throws java.io.IOException
This should probably be removed from this class.

Parameters:
ci -
path -
Returns:
Throws:
java.io.IOException