public interface

CommentGenerator

org.mybatis.generator.api.CommentGenerator
Known Indirect Subclasses

Class Overview

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

Summary

Public Methods
abstract void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable)
abstract void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, boolean markAsDoNotDelete)
abstract 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.
abstract void addConfigurationProperties(Properties properties)
Adds properties for this instance from any properties configured in the CommentGenerator configuration.
abstract void addEnumComment(InnerEnum innerEnum, IntrospectedTable introspectedTable)
abstract void addFieldComment(Field field, IntrospectedTable introspectedTable)
abstract void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
This method should add a Javadoc comment to the specified field.
abstract void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable)
abstract void addGetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
abstract void addJavaFileComment(CompilationUnit compilationUnit)
This method is called to add a file level comment to a generated java file.
abstract void addRootComment(XmlElement rootElement)
This method is called to add a comment as the first child of the root element.
abstract void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)

Public Methods

public abstract void addClassComment (InnerClass innerClass, IntrospectedTable introspectedTable)

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

public abstract 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.

public abstract 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

public abstract void addEnumComment (InnerEnum innerEnum, IntrospectedTable introspectedTable)

public abstract void addFieldComment (Field field, IntrospectedTable introspectedTable)

public abstract 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.

public abstract void addGeneralMethodComment (Method method, IntrospectedTable introspectedTable)

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

public abstract 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.

public abstract 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.

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