org.mybatis.generator.api
Interface CommentGenerator

All Known Implementing Classes:
DefaultCommentGenerator

public interface CommentGenerator

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

Author:
Jeff Butler

Method Summary
 void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable)
           
 void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, boolean markAsDoNotDelete)
           
 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(Properties properties)
          Adds properties for this instance from any properties configured in the CommentGenerator configuration.
 void addEnumComment(InnerEnum innerEnum, IntrospectedTable introspectedTable)
           
 void addFieldComment(Field field, IntrospectedTable introspectedTable)
           
 void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
          This method should add a Javadoc comment to the specified field.
 void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable)
           
 void addGetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
           
 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, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
           
 

Method Detail

addConfigurationProperties

void addConfigurationProperties(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,
                     IntrospectedTable introspectedTable,
                     IntrospectedColumn introspectedColumn)
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 "@mbggenerated" to the comment. Without this tag, the Eclipse based Java merge feature will fail.

Parameters:
field -
introspectedTable -
introspectedColumn -

addFieldComment

void addFieldComment(Field field,
                     IntrospectedTable introspectedTable)

addClassComment

void addClassComment(InnerClass innerClass,
                     IntrospectedTable introspectedTable)

addClassComment

void addClassComment(InnerClass innerClass,
                     IntrospectedTable introspectedTable,
                     boolean markAsDoNotDelete)

addEnumComment

void addEnumComment(InnerEnum innerEnum,
                    IntrospectedTable introspectedTable)

addGetterComment

void addGetterComment(Method method,
                      IntrospectedTable introspectedTable,
                      IntrospectedColumn introspectedColumn)

addSetterComment

void addSetterComment(Method method,
                      IntrospectedTable introspectedTable,
                      IntrospectedColumn introspectedColumn)

addGeneralMethodComment

void addGeneralMethodComment(Method method,
                             IntrospectedTable introspectedTable)

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 the generator 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.

Parameters:
xmlElement -

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 the generator repeatedly, you will only retain the comment from the initial run.

The default implementation does nothing.

Parameters:
rootElement -


Copyright © 2010-2012 MyBatis.org. All Rights Reserved.