|
12 | 12 | import org.apache.logging.log4j.Level; |
13 | 13 | import org.apache.logging.log4j.core.config.Configurator; |
14 | 14 |
|
| 15 | +import com.theodo.inspector.analyzer.ASTReader; |
| 16 | +import com.theodo.inspector.analyzer.AnnotationDto; |
| 17 | +import com.theodo.inspector.analyzer.AnnotationProcessing; |
| 18 | +import com.theodo.inspector.builder.HtmlBuilder; |
15 | 19 | import com.theodo.inspector.cli.InspectorCommand; |
16 | | -import com.theodo.inspector.impl.PreAuthorizeAnnotationProcessing; |
17 | | -import com.theodo.inspector.impl.ast.ASTReader; |
18 | | -import com.theodo.inspector.impl.utils.AnnotationDto; |
19 | | -import com.theodo.inspector.impl.utils.HtmlTableGenerator; |
20 | 20 |
|
21 | 21 | import lombok.Getter; |
22 | 22 | import lombok.extern.slf4j.Slf4j; |
23 | 23 | import picocli.CommandLine; |
24 | 24 | import spoon.reflect.CtModel; |
25 | 25 |
|
26 | | - |
27 | 26 | @Slf4j |
28 | 27 | public class SpringAccessInspector extends InspectorCommand { |
29 | 28 | public enum Editor { |
30 | | - VSCODE, |
31 | | - INTELLIJ, |
32 | | - NONE |
| 29 | + VSCODE, INTELLIJ, NONE |
33 | 30 | } |
34 | 31 |
|
35 | 32 | @Getter |
@@ -64,26 +61,24 @@ public List<AnnotationDto> analyzer() throws IOException { |
64 | 61 | List<AnnotationDto> annotations = new ArrayList<>(); |
65 | 62 | walk.forEach(pomFile -> { |
66 | 63 | CtModel astModel = ASTReader.readAst(pomFile); // Analyze JAVA AST |
67 | | - List<AnnotationDto> temporaryAnnotation = PreAuthorizeAnnotationProcessing |
68 | | - .visitAllAnnotations(astModel); |
| 64 | + List<AnnotationDto> temporaryAnnotation = AnnotationProcessing.visitAllAnnotations(astModel); |
69 | 65 | annotations.addAll(temporaryAnnotation); |
70 | 66 |
|
71 | 67 | }); |
72 | 68 | return annotations; |
73 | 69 | } |
74 | 70 | } |
75 | 71 |
|
76 | | - @Override |
77 | 72 | public Integer call() throws Exception { |
78 | 73 | List<AnnotationDto> annotations = analyzer(); |
79 | | - HtmlTableGenerator.generateHtmlTable(annotations, this.htmlOutputFile, this.editor); |
| 74 | + |
| 75 | + HtmlBuilder.generateHtmlTable(annotations, this.htmlOutputFile, this.editor); |
80 | 76 | return 0; |
81 | 77 | } |
82 | 78 |
|
83 | 79 | public static Stream<File> findPoms(String basePath) throws IOException { |
84 | 80 | // noinspection resource |
85 | | - return Files.walk(Paths.get(basePath)) |
86 | | - .filter(path -> path.getFileName().toString().contains("pom.xml")) |
| 81 | + return Files.walk(Paths.get(basePath)).filter(path -> path.getFileName().toString().contains("pom.xml")) |
87 | 82 | .map(Path::toFile); |
88 | 83 | } |
89 | 84 | } |
0 commit comments