1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.generator.api.dom.java;
17
18 import java.util.ArrayList;
19 import java.util.List;
20 import java.util.Set;
21 import java.util.TreeSet;
22
23 public class Interface extends InnerInterface implements CompilationUnit {
24
25 private final Set<FullyQualifiedJavaType> importedTypes = new TreeSet<>();
26
27 private final Set<String> staticImports = new TreeSet<>();
28
29 private final List<String> fileCommentLines = new ArrayList<>();
30
31 public Interface(FullyQualifiedJavaType type) {
32 super(type);
33 }
34
35 public Interface(String type) {
36 this(new FullyQualifiedJavaType(type));
37 }
38
39 @Override
40 public Set<FullyQualifiedJavaType> getImportedTypes() {
41 return importedTypes;
42 }
43
44 @Override
45 public void addImportedType(FullyQualifiedJavaType importedType) {
46 if (importedType.isExplicitlyImported()
47 && !importedType.getPackageName().equals(getType().getPackageName())) {
48 importedTypes.add(importedType);
49 }
50 }
51
52 @Override
53 public void addFileCommentLine(String commentLine) {
54 fileCommentLines.add(commentLine);
55 }
56
57 @Override
58 public List<String> getFileCommentLines() {
59 return fileCommentLines;
60 }
61
62 @Override
63 public void addImportedTypes(Set<FullyQualifiedJavaType> importedTypes) {
64 this.importedTypes.addAll(importedTypes);
65 }
66
67 @Override
68 public Set<String> getStaticImports() {
69 return staticImports;
70 }
71
72 @Override
73 public void addStaticImport(String staticImport) {
74 staticImports.add(staticImport);
75 }
76
77 @Override
78 public void addStaticImports(Set<String> staticImports) {
79 this.staticImports.addAll(staticImports);
80 }
81
82 @Override
83 public <R> R accept(CompilationUnitVisitor<R> visitor) {
84 return visitor.visit(this);
85 }
86 }