Clover coverage report - PMD - 3.9 Coverage timestamp: Tue Dec 19 2006 09:38:44 EST FRAMES NO FRAMES |
file stats: | LOC: | 34 |  | Methods: | 2
| NCLOC: | 16 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
SourceTypeToRuleLanguageMapper.java | - | 100% | 50% | 66.7% |

1 |  | package net.sourceforge.pmd;
2 |  |
3 |  | import java.util.Map;
4 |  |
5 |  | import net.sourceforge.pmd.util.CollectionUtil;
6 |  |
7 |  | /**
8 |  | * Mapping of SourceType to RuleLanguage.
9 |  | *
10 |  | * @author pieter_van_raemdonck - Application Engineers NV/SA - www.ae.be
11 |  | */
12 |  | public class SourceTypeToRuleLanguageMapper {
13 |  | /**
14 |  | * Map of SourceType on RuleLanguage.
15 |  | */
16 |  | private static Map mapSourceTypeOnRuleLanguage = CollectionUtil.mapFrom( new Object[][] {
17 |  | { SourceType.JAVA_13, Language.JAVA },
18 |  | { SourceType.JAVA_14, Language.JAVA },
19 |  | { SourceType.JAVA_15, Language.JAVA },
20 |  | { SourceType.JAVA_16, Language.JAVA },
21 |  | { SourceType.JSP, Language.JSP },
22 |  | });
23 |  |
24 | 0 | private SourceTypeToRuleLanguageMapper() {};
25 |  | /**
26 |  | * Get the RuleLanguage that corresponds to the given SourceType.
27 |  | *
28 |  | * @param sourceType the SourceType
29 |  | * @return a RuleLanguage
30 |  | */
31 | 2516 | public static Language getMappedLanguage(SourceType sourceType) {
32 | 2516 | return (Language) mapSourceTypeOnRuleLanguage.get(sourceType);
33 |  | }
34 |  | }