This repository has been archived by the owner on Apr 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 148
/
ViolationsRegistry.java
54 lines (49 loc) · 2.06 KB
/
ViolationsRegistry.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package hudson.plugins.warnings.parser;
import java.util.List;
import hudson.plugins.violations.types.codenarc.CodenarcParser;
import hudson.plugins.violations.types.gendarme.GendarmeParser;
import hudson.plugins.violations.types.jcreport.JcReportParser;
import hudson.plugins.violations.types.pep8.Pep8Parser;
import hudson.plugins.violations.types.stylecop.StyleCopParser;
/**
* Registers the parsers of the violations plug-in.
*
* @author Ulli Hafner
*/
public final class ViolationsRegistry {
/**
* Appends the parsers of the violations plug-in to the specified list of
* parsers.
*
* @param parsers
* the list of parsers that will be modified
*/
public static void addParsers(final List<AbstractWarningsParser> parsers) {
parsers.add(new ViolationsAdapter(new CodenarcParser(),
Messages._Warnings_Codenarc_ParserName(),
Messages._Warnings_Codenarc_LinkName(),
Messages._Warnings_Codenarc_TrendName()));
parsers.add(new ViolationsAdapter(new GendarmeParser(),
Messages._Warnings_Gendarme_ParserName(),
Messages._Warnings_Gendarme_LinkName(),
Messages._Warnings_Gendarme_TrendName()));
parsers.add(new ViolationsAdapter(new JcReportParser(),
Messages._Warnings_JCReport_ParserName(),
Messages._Warnings_JCReport_LinkName(),
Messages._Warnings_JCReport_TrendName()));
parsers.add(new ViolationsAdapter(new Pep8Parser(),
Messages._Warnings_Pep8_ParserName(),
Messages._Warnings_Pep8_LinkName(),
Messages._Warnings_Pep8_TrendName()));
parsers.add(new ViolationsAdapter(new StyleCopParser(),
Messages._Warnings_StyleCop_ParserName(),
Messages._Warnings_StyleCop_LinkName(),
Messages._Warnings_StyleCop_TrendName()));
}
/**
* Creates a new instance of {@link ViolationsRegistry}.
*/
private ViolationsRegistry() {
// prevents instantiation
}
}