|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.oscg.jreleaseinfo.SourceGenerator
The SourceGenerator is a simple implementation of the
SourceGeneratorIF interface. In this class the code to be
generated is hard coded.
Other implementation may provide extensions (like SourceGeneratorApp)
or other mechanism (like using a template engine, etc).
Field Summary | |
protected java.lang.String |
className
ClassName of version file to be created. |
protected java.util.Date |
newDate
Date for test purposes. |
protected java.lang.String |
packageName
PackageName of version file to be created, 'null' means default package. |
protected java.util.Map |
props
Membervariables for created class. |
Constructor Summary | |
SourceGenerator()
Default constructor. |
Method Summary | |
protected void |
createClassFooter(java.lang.StringBuffer buf)
Utility method to write the class footer code to a StringBuffer. |
protected void |
createClassHeader(java.lang.StringBuffer buf)
Utility method to write the class header code to a StringBuffer. |
protected void |
createClassInfoHeader(java.lang.StringBuffer buf)
Utility method to write the class header code to a StringBuffer. |
java.lang.String |
createCode()
Utility method to write the class java code to a String. |
protected void |
createMethods(java.lang.StringBuffer buf)
Utility method to write the class method code to a StringBuffer. |
void |
setClassName(java.lang.String className)
Set the classname. |
void |
setPackageName(java.lang.String packageName)
Set the packagename. |
void |
setProperties(java.util.Map props)
Set the property map. |
protected void |
writeDateMethod(java.lang.StringBuffer buf,
java.lang.String type,
java.lang.String name,
java.util.Date date)
Utility method to write java code for an date method to a StringBuffer. |
protected void |
writeln(java.lang.StringBuffer buf)
Utility method to write an empty line to the StringBuffer. |
protected void |
writeln(java.lang.StringBuffer buf,
java.lang.String line)
Utility method to write a line to the StringBuffer and append a line break. |
protected void |
writeMethodDeclaration(java.lang.StringBuffer buf,
java.lang.String type,
java.lang.String methodName,
java.lang.String name,
java.lang.String value,
java.lang.String preset)
Utility method to write a method declaration |
protected void |
writeObjectDeclaration(java.lang.StringBuffer buf,
java.lang.String type,
java.lang.String lName,
java.lang.String value)
Utility method to write a method declaration |
protected void |
writeObjectMethod(java.lang.StringBuffer buf,
java.lang.String type,
java.lang.String name,
java.lang.String value)
Utility method to write java code for an object method to a StringBuffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String className
protected java.lang.String packageName
protected java.util.Map props
protected java.util.Date newDate
Constructor Detail |
public SourceGenerator()
Method Detail |
public void setPackageName(java.lang.String packageName)
setPackageName
in interface SourceGeneratorIF
packageName
- public void setClassName(java.lang.String className)
setClassName
in interface SourceGeneratorIF
className
- public void setProperties(java.util.Map props)
setProperties
in interface SourceGeneratorIF
public java.lang.String createCode()
createCode
in interface SourceGeneratorIF
protected void createClassInfoHeader(java.lang.StringBuffer buf)
buf
- StringBuffer to write intoprotected void createClassHeader(java.lang.StringBuffer buf)
buf
- StringBuffer to write intoprotected void createClassFooter(java.lang.StringBuffer buf)
buf
- StringBuffer to write intoprotected void createMethods(java.lang.StringBuffer buf)
buf
- StringBuffer to write intoprotected void writeObjectMethod(java.lang.StringBuffer buf, java.lang.String type, java.lang.String name, java.lang.String value)
buf
- StringBuffer to write intotype
- must be one of the TYPE_OBJ_xxx Stringsname
- of Propertyvalue
- ReturnValue of Propertyprotected void writeDateMethod(java.lang.StringBuffer buf, java.lang.String type, java.lang.String name, java.util.Date date)
buf
- StringBuffer to write intotype
- must be TYPE_OBJ_DATEname
- of Propertyprotected void writeObjectDeclaration(java.lang.StringBuffer buf, java.lang.String type, java.lang.String lName, java.lang.String value)
buf
- StringBuffer to write intotype
- String return typeprotected void writeMethodDeclaration(java.lang.StringBuffer buf, java.lang.String type, java.lang.String methodName, java.lang.String name, java.lang.String value, java.lang.String preset)
buf
- StringBuffer to write intotype
- String return typeprotected void writeln(java.lang.StringBuffer buf, java.lang.String line)
buf
- StringBuffer to write intoline
- String to append to bufprotected void writeln(java.lang.StringBuffer buf)
buf
- StringBuffer to write into
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |