• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mybatis / generator / 1646

21 Apr 2025 10:17PM UTC coverage: 88.157% (-0.2%) from 88.328%
1646

push

github

hazendaz
[ci] Run auto formatting

2518 of 3412 branches covered (73.8%)

994 of 1117 new or added lines in 164 files covered. (88.99%)

23 existing lines in 12 files now uncovered.

10578 of 11999 relevant lines covered (88.16%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/core/mybatis-generator-core/src/main/java/org/mybatis/generator/api/ProgressCallback.java
1
/*
2
 *    Copyright 2006-2025 the original author or authors.
3
 *
4
 *    Licensed under the Apache License, Version 2.0 (the "License");
5
 *    you may not use this file except in compliance with the License.
6
 *    You may obtain a copy of the License at
7
 *
8
 *       https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *    Unless required by applicable law or agreed to in writing, software
11
 *    distributed under the License is distributed on an "AS IS" BASIS,
12
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *    See the License for the specific language governing permissions and
14
 *    limitations under the License.
15
 */
16
package org.mybatis.generator.api;
17

18
/**
19
 * This interface can be implemented to return progress information from the file generation process.
20
 * <p>
21
 * During the execution of code generation, there are three main operations: database introspection, code generation
22
 * based on the results of introspection, and then merging/saving generated files. Methods in this interface accordingly
23
 * and in this order:
24
 * <ol>
25
 * <li>introspectionStarted(int)</li>
26
 * <li>(Repeatedly) startTask(String)</li>
27
 * <li>generationStarted(int)</li>
28
 * <li>(Repeatedly) startTask(String)</li>
29
 * <li>saveStarted(int)</li>
30
 * <li>(Repeatedly) startTask(String)</li>
31
 * <li>done()</li>
32
 * </ol>
33
 * <p>
34
 * Periodically, the <code>checkCancel()</code> method will be called to see if the method should be canceled.
35
 * <p>
36
 * For planning purposes, the most common use case will have a ratio of 20% introspection tasks, 40% generation tasks,
37
 * and 40% save tasks.
38
 *
39
 * @author Jeff Butler
40
 */
41
public interface ProgressCallback {
42
    /**
43
     * Called to note the start of the introspection phase, and to note the maximum number of startTask messages that
44
     * will be sent for the introspection phase.
45
     *
46
     * @param totalTasks
47
     *            the maximum number of times startTask will be called for the introspection phase.
48
     */
49
    default void introspectionStarted(int totalTasks) {
50
    }
1✔
51

52
    /**
53
     * Called to note the start of the generation phase, and to note the maximum number of startTask messages that will
54
     * be sent for the generation phase.
55
     *
56
     * @param totalTasks
57
     *            the maximum number of times startTask will be called for the generation phase.
58
     */
59
    default void generationStarted(int totalTasks) {
60
    }
1✔
61

62
    /**
63
     * Called to note the start of the file saving phase, and to note the maximum number of startTask messages that will
64
     * be sent for the file saving phase.
65
     *
66
     * @param totalTasks
67
     *            the maximum number of times startTask will be called for the file saving phase.
68
     */
69
    default void saveStarted(int totalTasks) {
NEW
70
    }
×
71

72
    /**
73
     * Called to denote the beginning of a save task.
74
     *
75
     * @param taskName
76
     *            a descriptive name of the current work step
77
     */
78
    default void startTask(String taskName) {
79
    }
1✔
80

81
    /**
82
     * This method is called when all generated files have been saved.
83
     */
84
    default void done() {
85
    }
1✔
86

87
    /**
88
     * The method is called periodically during a long-running method. If the implementation throws
89
     * <code>InterruptedException</code> then the method will be canceled. Any files that have already been saved will
90
     * remain on the file system.
91
     *
92
     * @throws InterruptedException
93
     *             if the operation should be halted
94
     */
95
    default void checkCancel() throws InterruptedException {
96
    }
1✔
97
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc