1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.model.building;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24 import org.apache.maven.model.Model;
25
26
27
28
29
30
31 public class SimpleProblemCollector implements ModelProblemCollector {
32 private Model model;
33
34 private List<String> warnings = new ArrayList<>();
35
36 private List<String> errors = new ArrayList<>();
37
38 private List<String> fatals = new ArrayList<>();
39
40 public SimpleProblemCollector() {}
41
42 public SimpleProblemCollector(Model model) {
43 this.model = model;
44 }
45
46 public Model getModel() {
47 return model;
48 }
49
50 public List<String> getWarnings() {
51 return warnings;
52 }
53
54 public List<String> getErrors() {
55 return errors;
56 }
57
58 public List<String> getFatals() {
59 return fatals;
60 }
61
62 public void add(ModelProblemCollectorRequest req) {
63 switch (req.getSeverity()) {
64 case FATAL:
65 fatals.add(req.getMessage());
66 break;
67 case ERROR:
68 errors.add(req.getMessage());
69 break;
70 case WARNING:
71 warnings.add(req.getMessage());
72 break;
73 }
74 }
75 }