public interface CommentGenerator
Modifier and Type | Method and Description |
---|---|
default void |
addClassAnnotation(InnerClass innerClass,
IntrospectedTable introspectedTable,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a class.
|
default void |
addClassComment(InnerClass innerClass,
IntrospectedTable introspectedTable)
Adds the inner class comment.
|
default void |
addClassComment(InnerClass innerClass,
IntrospectedTable introspectedTable,
boolean markAsDoNotDelete)
Adds the inner class comment.
|
default 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.
|
default void |
addEnumComment(InnerEnum innerEnum,
IntrospectedTable introspectedTable)
Adds the enum comment.
|
default void |
addFieldAnnotation(Field field,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a field.
|
default void |
addFieldAnnotation(Field field,
IntrospectedTable introspectedTable,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a field.
|
default void |
addFieldComment(Field field,
IntrospectedTable introspectedTable)
Adds the field comment.
|
default void |
addFieldComment(Field field,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn)
This method should add a Javadoc comment to the specified field.
|
default void |
addFileComment(KotlinFile kotlinFile)
This method is called to add a file level comment to a generated Kotlin file.
|
default void |
addGeneralFunctionComment(KotlinFunction kf,
IntrospectedTable introspectedTable,
Set<String> imports) |
default void |
addGeneralMethodAnnotation(Method method,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a method.
|
default void |
addGeneralMethodAnnotation(Method method,
IntrospectedTable introspectedTable,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a method.
|
default void |
addGeneralMethodComment(Method method,
IntrospectedTable introspectedTable)
Adds the general method comment.
|
default void |
addGeneralPropertyComment(KotlinProperty property,
IntrospectedTable introspectedTable,
Set<String> imports) |
default void |
addGetterComment(Method method,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn)
Adds the getter comment.
|
default void |
addJavaFileComment(CompilationUnit compilationUnit)
This method is called to add a file level comment to a generated java file.
|
default void |
addModelClassComment(KotlinType modelClass,
IntrospectedTable introspectedTable)
Adds a comment for a model class.
|
default void |
addModelClassComment(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable)
Adds a comment for a model class.
|
default void |
addRootComment(XmlElement rootElement)
This method is called to add a comment as the first child of the root element.
|
default void |
addSetterComment(Method method,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn)
Adds the setter comment.
|
void addConfigurationProperties(Properties properties)
This method will be called before any of the other methods.
properties
- All properties from the configurationdefault void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
Important: This method should add a the nonstandard JavaDoc tag "@mbg.generated" to the comment. Without this tag, the Eclipse based Java merge feature will fail.
field
- the fieldintrospectedTable
- the introspected tableintrospectedColumn
- the introspected columndefault void addFieldComment(Field field, IntrospectedTable introspectedTable)
field
- the fieldintrospectedTable
- the introspected tabledefault void addModelClassComment(TopLevelClass topLevelClass, IntrospectedTable introspectedTable)
Because of difficulties with the Java file merger, the default implementation of this method should NOT add comments. Comments should only be added if specifically requested by the user (for example, by enabling table remark comments).
topLevelClass
- the top level classintrospectedTable
- the introspected tabledefault void addModelClassComment(KotlinType modelClass, IntrospectedTable introspectedTable)
modelClass
- the generated KotlinType for the modelintrospectedTable
- the introspected tabledefault void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable)
innerClass
- the inner classintrospectedTable
- the introspected tabledefault void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, boolean markAsDoNotDelete)
innerClass
- the inner classintrospectedTable
- the introspected tablemarkAsDoNotDelete
- the mark as do not deletedefault void addEnumComment(InnerEnum innerEnum, IntrospectedTable introspectedTable)
innerEnum
- the inner enumintrospectedTable
- the introspected tabledefault void addGetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
method
- the methodintrospectedTable
- the introspected tableintrospectedColumn
- the introspected columndefault void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
method
- the methodintrospectedTable
- the introspected tableintrospectedColumn
- the introspected columndefault void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable)
method
- the methodintrospectedTable
- the introspected tabledefault void addJavaFileComment(CompilationUnit compilationUnit)
The default implementation does nothing.
compilationUnit
- the compilation unitdefault void addComment(XmlElement xmlElement)
xmlElement
- the xml elementdefault void addRootComment(XmlElement rootElement)
The default implementation does nothing.
rootElement
- the root elementdefault void addGeneralMethodAnnotation(Method method, IntrospectedTable introspectedTable, Set<FullyQualifiedJavaType> imports)
method
- the methodintrospectedTable
- the introspected tableimports
- the comment generator may add a required imported type to this listdefault void addGeneralMethodAnnotation(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn, Set<FullyQualifiedJavaType> imports)
method
- the methodintrospectedTable
- the introspected tableintrospectedColumn
- thr introspected columnimports
- the comment generator may add a required imported type to this listdefault void addFieldAnnotation(Field field, IntrospectedTable introspectedTable, Set<FullyQualifiedJavaType> imports)
field
- the fieldintrospectedTable
- the introspected tableimports
- the comment generator may add a required imported type to this listdefault void addFieldAnnotation(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn, Set<FullyQualifiedJavaType> imports)
field
- the fieldintrospectedTable
- the introspected tableintrospectedColumn
- the introspected columnimports
- the comment generator may add a required imported type to this listdefault void addClassAnnotation(InnerClass innerClass, IntrospectedTable introspectedTable, Set<FullyQualifiedJavaType> imports)
innerClass
- the classintrospectedTable
- the introspected tableimports
- the comment generator may add a required imported type to this listdefault void addFileComment(KotlinFile kotlinFile)
The default implementation does nothing.
kotlinFile
- the Kotlin filedefault void addGeneralFunctionComment(KotlinFunction kf, IntrospectedTable introspectedTable, Set<String> imports)
default void addGeneralPropertyComment(KotlinProperty property, IntrospectedTable introspectedTable, Set<String> imports)
Copyright © 2006–2022 MyBatis.org. All rights reserved.