org.apache.ibatis.ibator.api
Interface CommentGenerator

All Known Implementing Classes:
DefaultCommentGenerator

public interface CommentGenerator

Implementations of this interface are used to generate comments for the various artifacts generated by ibator.

Author:
Jeff Butler

Method Summary
 void addClassComment(InnerClass innerClass, FullyQualifiedTable table)
           
 void addComment(XmlElement xmlElement)
          This method should add a suitable comment as a child element of the specified xmlElement to warn users that the element was generated and is subject to regeneration.
 void addConfigurationProperties(java.util.Properties properties)
          Adds properties for this instance from any properties configured in the CommentGenerator configuration.
 void addEnumComment(InnerEnum innerEnum, FullyQualifiedTable table)
           
 void addFieldComment(Field field, FullyQualifiedTable table)
           
 void addFieldComment(Field field, FullyQualifiedTable table, java.lang.String columnName)
          This method should add a Javadoc comment to the specified field.
 void addGeneralMethodComment(Method method, FullyQualifiedTable table)
           
 void addGetterComment(Method method, FullyQualifiedTable table, java.lang.String columnName)
           
 void addJavaFileComment(CompilationUnit compilationUnit)
          This method is called to add a file level comment to a generated java file.
 void addRootComment(XmlElement rootElement)
          This method is called to add a comment as the first child of the root element.
 void addSetterComment(Method method, FullyQualifiedTable table, java.lang.String columnName)
           
 

Method Detail

addConfigurationProperties

void addConfigurationProperties(java.util.Properties properties)
Adds properties for this instance from any properties configured in the CommentGenerator configuration. This method will be called before any of the other methods.

Parameters:
properties - All properties from the configuration

addFieldComment

void addFieldComment(Field field,
                     FullyQualifiedTable table,
                     java.lang.String columnName)
This method should add a Javadoc comment to the specified field. The field is related to the specified table and is used to hold the value of the specified column.

Important: This method should add a the nonstandard JavaDoc tag "@ibatorgenerated" to the comment. Without this tag, the Eclipse based Java merge feature will fail.

Parameters:
field -
table -
columnName -

addFieldComment

void addFieldComment(Field field,
                     FullyQualifiedTable table)

addClassComment

void addClassComment(InnerClass innerClass,
                     FullyQualifiedTable table)

addEnumComment

void addEnumComment(InnerEnum innerEnum,
                    FullyQualifiedTable table)

addGetterComment

void addGetterComment(Method method,
                      FullyQualifiedTable table,
                      java.lang.String columnName)

addSetterComment

void addSetterComment(Method method,
                      FullyQualifiedTable table,
                      java.lang.String columnName)

addGeneralMethodComment

void addGeneralMethodComment(Method method,
                             FullyQualifiedTable table)

addJavaFileComment

void addJavaFileComment(CompilationUnit compilationUnit)
This method is called to add a file level comment to a generated java file. This method could be used to add a general file comment (such as a copyright notice). However, note that the Java file merge function in Eclipse does not deal with this comment. If you run ibator repeatedly, you will only retain the comment from the initial run.

The default implementation does nothing.

Parameters:
compilationUnit -

addComment

void addComment(XmlElement xmlElement)
This method should add a suitable comment as a child element of the specified xmlElement to warn users that the element was generated and is subject to regeneration.


addRootComment

void addRootComment(XmlElement rootElement)
This method is called to add a comment as the first child of the root element. This method could be used to add a general file comment (such as a copyright notice). However, note that the XML file merge function does not deal with this comment. If you run ibator repeatedly, you will only retain the comment from the initial run.

The default implementation does nothing.

Parameters:
rootElement -