ch.oscg.jreleaseinfo
Class SourceGeneratorApp

java.lang.Object
  extended bych.oscg.jreleaseinfo.SourceGenerator
      extended bych.oscg.jreleaseinfo.SourceGeneratorApp
All Implemented Interfaces:
SourceGeneratorIF

public class SourceGeneratorApp
extends SourceGenerator

The SourceGenerator is a simple implementation of the SourceGeneratorIF interface. In this class the code to be generated is hard coded.
This implementation adds code which shows the build information in a frame as default main-class of the jar file.
This is usefull for libraries, which do not have a main-class definition in the manifest.

Version:
$Revision: 1.2 $ ($Date: 2005/08/06 14:11:18 $ / $Author: tcotting $)
Author:
Thomas Cotting, Tangarena Engineering AG, Luzern

Field Summary
 
Fields inherited from class ch.oscg.jreleaseinfo.SourceGenerator
className, newDate, packageName, props
 
Constructor Summary
SourceGeneratorApp()
          Default constructor.
 
Method Summary
 java.lang.String createCode()
          Utility method to write the class java code to a String.
protected  void createMainMethod(java.lang.StringBuffer buf, java.lang.String filename)
          Utility method to write a the code for the main method.
protected  void createViewerClass(java.lang.StringBuffer buf, java.lang.String viewerType)
          Utility method to write a the code for the viewer class.
 
Methods inherited from class ch.oscg.jreleaseinfo.SourceGenerator
createClassFooter, createClassHeader, createClassInfoHeader, createMethods, setClassName, setPackageName, setProperties, writeDateMethod, writeln, writeln, writeMethodDeclaration, writeObjectDeclaration, writeObjectMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceGeneratorApp

public SourceGeneratorApp()
Default constructor.

Method Detail

createCode

public java.lang.String createCode()
Utility method to write the class java code to a String. This methods overwrites the method from SourceGenerator, adding code through createViewerCall().

Specified by:
createCode in interface SourceGeneratorIF
Overrides:
createCode in class SourceGenerator
Returns:
the created java class in a string

createViewerClass

protected void createViewerClass(java.lang.StringBuffer buf,
                                 java.lang.String viewerType)
Utility method to write a the code for the viewer class.

Parameters:
buf - StringBuffer to write into

createMainMethod

protected void createMainMethod(java.lang.StringBuffer buf,
                                java.lang.String filename)
Utility method to write a the code for the main method.

Parameters:
buf - StringBuffer to write into


Copyright © 2005 Open Source Competence Group (OSCG). All Rights Reserved.