public interface ProgressCallback
During the execution of code generation, there are three main operations: database introspection, code generation based on the results of introspection, and then merging/saving generated files. Methods in this interface accordingly and in this order:
Periodically, the checkCancel()
method will be called to see if the
method should be canceled.
For planning purposes, the most common use case will have a ratio of 20% introspection tasks, 40% generation tasks, and 40% save tasks.
Modifier and Type | Method and Description |
---|---|
default void |
checkCancel()
The method is called periodically during a long running method.
|
default void |
done()
This method is called when all generated files have been saved.
|
default void |
generationStarted(int totalTasks)
Called to note the start of the generation phase, and to note the maximum
number of startTask messages that will be sent for the generation phase.
|
default void |
introspectionStarted(int totalTasks)
Called to note the start of the introspection phase, and to note the
maximum number of startTask messages that will be sent for the
introspection phase.
|
default void |
saveStarted(int totalTasks)
Called to note the start of the file saving phase, and to note the
maximum number of startTask messages that will be sent for the file
saving phase phase.
|
default void |
startTask(String taskName)
Called to denote the beginning of a save task.
|
default void introspectionStarted(int totalTasks)
totalTasks
- the maximum number of times startTask will be called for the
introspection phase.default void generationStarted(int totalTasks)
totalTasks
- the maximum number of times startTask will be called for the
generation phase.default void saveStarted(int totalTasks)
totalTasks
- the maximum number of times startTask will be called for the
file saving phase.default void startTask(String taskName)
taskName
- a descriptive name of the current work stepdefault void done()
default void checkCancel() throws InterruptedException
InterruptedException
then
the method will be canceled. Any files that have already been saved will
remain on the file system.InterruptedException
- if the operation should be haltedCopyright © 2006–2022 MyBatis.org. All rights reserved.