org.openbp.cockpit.template.standard
Class ActivitySrcTemplate

java.lang.Object
  extended by org.openbp.common.template.TemplateBase
      extended by org.openbp.cockpit.template.standard.JavaSrcTemplate
          extended by org.openbp.cockpit.template.standard.ActivitySrcTemplate

public class ActivitySrcTemplate
extends JavaSrcTemplate

Activity implementation source code template.

Author:
Heiko Erhardt

Field Summary
protected  JavaActivityItem activity
          Activity item
protected  java.lang.StringBuffer inputComment
          Method comment that describes the input sockets/parameters
protected  java.util.List inputParamAccess
          Code for input parameter access
protected  java.lang.StringBuffer outputComment
          Method comment that describes the output sockets/parameters
protected  java.util.List outputParamAccess
          Code for output parameter access
protected  java.lang.String standardExitSocket
          Name of the standard exit socket, if any
 
Constructor Summary
ActivitySrcTemplate()
          Constructor.
 
Method Summary
 void generate(java.lang.Object[] templateArgs)
          This method is called when the template executes.
protected  java.lang.String makeParamName(java.lang.String name)
          Returns the name of the symbolic constant for the specified parameter.
protected  java.lang.String makeSocketName(java.lang.String name)
          Returns the name of the symbolic constant for the specified socket.
protected  void prepareSocketInfo(JavaTemplateWriter w, java.util.List socketList)
          Collects data to build the list of symbolic constants ('socketConstants' and 'paramConstants' placeholders) and input and output socket/parameter explanations (goes into the class comment).
protected  void printClassCode(JavaTemplateWriter w)
          Prints the class code.
protected  void printClassComment(JavaTemplateWriter w)
          Prints the class comment.
protected  void printFile(JavaTemplateWriter w)
          Performs the generation.
protected  void printImplemenationCodeInsideTag(JavaTemplateWriter w)
          Prints the class implementation code inside the {{*Handler implementation tag.
protected  void printImplemenationCodeOutsideTag(JavaTemplateWriter w)
          Prints the class implementation code outside the {{*Handler implementation tag.
 
Methods inherited from class org.openbp.cockpit.template.standard.JavaSrcTemplate
adverb, createComment, createComment, determineJavaType, errMsg, errMsg, extractUnqualifiedName, printFileHeader, removeDot, singular
 
Methods inherited from class org.openbp.common.template.TemplateBase
addResultFileInfo, callTemplate, getOutputDir, getProperties, getProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activity

protected JavaActivityItem activity
Activity item


inputComment

protected java.lang.StringBuffer inputComment
Method comment that describes the input sockets/parameters


outputComment

protected java.lang.StringBuffer outputComment
Method comment that describes the output sockets/parameters


inputParamAccess

protected java.util.List inputParamAccess
Code for input parameter access


outputParamAccess

protected java.util.List outputParamAccess
Code for output parameter access


standardExitSocket

protected java.lang.String standardExitSocket
Name of the standard exit socket, if any

Constructor Detail

ActivitySrcTemplate

public ActivitySrcTemplate()
Constructor.

Method Detail

generate

public void generate(java.lang.Object[] templateArgs)
              throws java.lang.Exception
This method is called when the template executes.

Specified by:
generate in class TemplateBase
Parameters:
templateArgs - Template arguments provided by the caller (null in this case)
Throws:
java.lang.Exception - On error

printFile

protected void printFile(JavaTemplateWriter w)
                  throws java.lang.Exception
Performs the generation.

Parameters:
w - Source file writer
Throws:
java.lang.Exception - On error

printClassComment

protected void printClassComment(JavaTemplateWriter w)
                          throws java.lang.Exception
Prints the class comment.

Parameters:
w - Source file writer
Throws:
java.lang.Exception - On error

printClassCode

protected void printClassCode(JavaTemplateWriter w)
                       throws java.lang.Exception
Prints the class code.

Parameters:
w - Source file writer
Throws:
java.lang.Exception - On error

printImplemenationCodeOutsideTag

protected void printImplemenationCodeOutsideTag(JavaTemplateWriter w)
                                         throws java.lang.Exception
Prints the class implementation code outside the {{*Handler implementation tag.

Parameters:
w - Source file writer
Throws:
java.lang.Exception - On error

printImplemenationCodeInsideTag

protected void printImplemenationCodeInsideTag(JavaTemplateWriter w)
                                        throws java.lang.Exception
Prints the class implementation code inside the {{*Handler implementation tag.

Parameters:
w - Source file writer
Throws:
java.lang.Exception - On error

prepareSocketInfo

protected void prepareSocketInfo(JavaTemplateWriter w,
                                 java.util.List socketList)
Collects data to build the list of symbolic constants ('socketConstants' and 'paramConstants' placeholders) and input and output socket/parameter explanations (goes into the class comment).

Parameters:
w - Source file writer
socketList - Socket list

makeSocketName

protected java.lang.String makeSocketName(java.lang.String name)
Returns the name of the symbolic constant for the specified socket. Either the standard socket name constant from the CoreConstants class or SOCKET_'upperName'.

Parameters:
name - Name
Returns:
The socket name

makeParamName

protected java.lang.String makeParamName(java.lang.String name)
Returns the name of the symbolic constant for the specified parameter.

Parameters:
name - Name
Returns:
The param name


Copyright © 2011. All Rights Reserved.