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

mybatis / generator / 2040

12 Feb 2026 07:46PM UTC coverage: 89.916% (-0.02%) from 89.94%
2040

Pull #1449

github

web-flow
Merge 368c58df8 into a9972eead
Pull Request #1449: Refactor the annotated method generators

2294 of 3067 branches covered (74.8%)

183 of 183 new or added lines in 33 files covered. (100.0%)

2 existing lines in 1 file now uncovered.

11600 of 12901 relevant lines covered (89.92%)

0.9 hits per line

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

85.19
/core/mybatis-generator-core/src/main/java/org/mybatis/generator/api/dom/java/JavaElement.java
1
/*
2
 *    Copyright 2006-2026 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.dom.java;
17

18
import java.util.ArrayList;
19
import java.util.List;
20

21
public abstract class JavaElement {
22

23
    private final List<String> javaDocLines = new ArrayList<>();
1✔
24

25
    private JavaVisibility visibility = JavaVisibility.DEFAULT;
1✔
26

27
    private boolean isStatic;
28

29
    private final List<String> annotations = new ArrayList<>();
1✔
30

31
    protected JavaElement() {
32
        super();
1✔
33
    }
1✔
34

35
    protected JavaElement(JavaElement original) {
1✔
36
        this.annotations.addAll(original.annotations);
1✔
37
        this.isStatic = original.isStatic;
1✔
38
        this.javaDocLines.addAll(original.javaDocLines);
1✔
39
        this.visibility = original.visibility;
1✔
40
    }
1✔
41

42
    public List<String> getJavaDocLines() {
43
        return javaDocLines;
1✔
44
    }
45

46
    public void addJavaDocLine(String javaDocLine) {
47
        javaDocLines.add(javaDocLine);
1✔
48
    }
1✔
49

50
    public List<String> getAnnotations() {
51
        return annotations;
1✔
52
    }
53

54
    public void addAnnotation(String annotation) {
55
        annotations.add(annotation);
1✔
56
    }
1✔
57

58
    public void addAnnotations(List<String> annotations) {
UNCOV
59
        this.annotations.addAll(annotations);
×
UNCOV
60
    }
×
61

62
    public JavaVisibility getVisibility() {
63
        return visibility;
1✔
64
    }
65

66
    public void setVisibility(JavaVisibility visibility) {
67
        this.visibility = visibility;
1✔
68
    }
1✔
69

70
    public void addSuppressTypeWarningsAnnotation() {
71
        addAnnotation("@SuppressWarnings(\"unchecked\")"); //$NON-NLS-1$
×
72
    }
×
73

74
    public boolean isStatic() {
75
        return isStatic;
1✔
76
    }
77

78
    public void setStatic(boolean isStatic) {
79
        this.isStatic = isStatic;
1✔
80
    }
1✔
81
}
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

© 2026 Coveralls, Inc