1 | /** |
---|
2 | * This software is copyright (c) 2014 by |
---|
3 | * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
4 | * This is free software. You can redistribute it |
---|
5 | * and/or modify it under the terms described in |
---|
6 | * the GNU General Public License v3 of which you |
---|
7 | * should have received a copy. Otherwise you can download |
---|
8 | * it from |
---|
9 | * |
---|
10 | * http://www.gnu.org/licenses/gpl-3.0.txt |
---|
11 | * |
---|
12 | * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
13 | * |
---|
14 | * @license http://www.gnu.org/licenses/gpl-3.0.txt |
---|
15 | * GNU General Public License v3 |
---|
16 | */ |
---|
17 | package eu.clarin.cmdi.validator; |
---|
18 | |
---|
19 | import java.io.File; |
---|
20 | import java.util.List; |
---|
21 | |
---|
22 | |
---|
23 | public interface CMDIValidationReport { |
---|
24 | public enum Severity { |
---|
25 | INFO { |
---|
26 | @Override |
---|
27 | public String getShortcut() { |
---|
28 | return "I"; |
---|
29 | } |
---|
30 | |
---|
31 | @Override |
---|
32 | public int priority() { |
---|
33 | return 1; |
---|
34 | } |
---|
35 | }, |
---|
36 | WARNING { |
---|
37 | @Override |
---|
38 | public String getShortcut() { |
---|
39 | return "W"; |
---|
40 | } |
---|
41 | |
---|
42 | @Override |
---|
43 | public int priority() { |
---|
44 | return 2; |
---|
45 | } |
---|
46 | }, |
---|
47 | ERROR { |
---|
48 | @Override |
---|
49 | public String getShortcut() { |
---|
50 | return "E"; |
---|
51 | } |
---|
52 | |
---|
53 | @Override |
---|
54 | public int priority() { |
---|
55 | return 3; |
---|
56 | } |
---|
57 | }; |
---|
58 | |
---|
59 | public abstract String getShortcut(); |
---|
60 | |
---|
61 | |
---|
62 | public abstract int priority(); |
---|
63 | } // enum Severity |
---|
64 | |
---|
65 | public interface Message { |
---|
66 | public Severity getSeverity(); |
---|
67 | |
---|
68 | |
---|
69 | public int getLineNumber(); |
---|
70 | |
---|
71 | |
---|
72 | public int getColumnNumber(); |
---|
73 | |
---|
74 | |
---|
75 | public String getMessage(); |
---|
76 | |
---|
77 | |
---|
78 | public Throwable getCause(); |
---|
79 | } // interface Message |
---|
80 | |
---|
81 | |
---|
82 | public File getFile(); |
---|
83 | |
---|
84 | |
---|
85 | public boolean isSuccess(); |
---|
86 | |
---|
87 | |
---|
88 | public boolean isWarning(); |
---|
89 | |
---|
90 | |
---|
91 | public boolean isFailed(); |
---|
92 | |
---|
93 | |
---|
94 | public Severity getHighestSeverity(); |
---|
95 | |
---|
96 | |
---|
97 | public boolean isHighestSeverity(Severity severity); |
---|
98 | |
---|
99 | |
---|
100 | public List<Message> getMessages(); |
---|
101 | |
---|
102 | |
---|
103 | public Message getFirstMessage(); |
---|
104 | |
---|
105 | |
---|
106 | public Message getFirstMessage(Severity severity); |
---|
107 | |
---|
108 | |
---|
109 | public int getMessageCount(); |
---|
110 | |
---|
111 | |
---|
112 | public int getMessageCount(Severity severity); |
---|
113 | |
---|
114 | } // CMDIValidatorResult |
---|