|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.template.TemplateBase
org.openbp.cockpit.template.standard.JavaSrcTemplate
public abstract class JavaSrcTemplate
Base class for Java source code templates. Input: Visual items. Note that we do not define the generate method (which creates the JavaTemplateWriter), we just provide methods to call from the generate method.
| Constructor Summary | |
|---|---|
JavaSrcTemplate()
Constructor. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
adverb(java.lang.String s)
Returns an engish adverb for the given substantive. |
protected java.lang.String |
createComment(DisplayObject o)
Creates a comment for the given object. |
protected java.lang.String |
createComment(DisplayObject o,
java.lang.String text)
Creates a comment for the given object. |
protected java.lang.String |
determineJavaType(JavaTemplateWriter w,
DataTypeItem dataType)
Determines the Java type of the given data type item. |
protected void |
errMsg(PrintNameProvider o,
java.lang.String msg)
Displays an error message to stdout, preceeded by the fully qualified name of the supplied object. |
protected void |
errMsg(java.lang.String msg)
Displays an error message to stdout, preceeded by the fully qualified name of the current item. |
protected java.lang.String |
extractUnqualifiedName(JavaTemplateWriter w,
java.lang.String qualifiedName)
Extracts the unqualified name from the given class name. |
protected void |
printFileHeader(JavaTemplateWriter w)
Prints the file header of the source code file. |
protected java.lang.String |
removeDot(java.lang.String s)
Removes a trailing dot if present. |
protected java.lang.String |
singular(java.lang.String s)
Returns the singular name of the given type name description string. |
| Methods inherited from class org.openbp.common.template.TemplateBase |
|---|
addResultFileInfo, callTemplate, generate, getOutputDir, getProperties, getProperty, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavaSrcTemplate()
| Method Detail |
|---|
protected void printFileHeader(JavaTemplateWriter w)
throws java.lang.Exception
w - Source file writer
java.lang.Exception - On error
protected java.lang.String createComment(DisplayObject o,
java.lang.String text)
o - Object to describetext - Text to print in the line after the display name or null
protected java.lang.String createComment(DisplayObject o)
o - Object to describe
protected java.lang.String determineJavaType(JavaTemplateWriter w,
DataTypeItem dataType)
w - Source file writerdataType - Data type
protected java.lang.String extractUnqualifiedName(JavaTemplateWriter w,
java.lang.String qualifiedName)
w - Source file writerqualifiedName - Qualified or unqualified name
protected java.lang.String singular(java.lang.String s)
s - String to inspect
protected java.lang.String removeDot(java.lang.String s)
s - String to inspect
protected java.lang.String adverb(java.lang.String s)
s - The substantive
protected void errMsg(PrintNameProvider o,
java.lang.String msg)
o - Display object or null for the current itemmsg - Error messsageprotected void errMsg(java.lang.String msg)
msg - Error messsage
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||