Clover coverage report - PMD - 3.7 Coverage timestamp: Wed May 31 2006 09:25:59 EDT FRAMES NO FRAMES |
file stats: | LOC: | 34 |  | Methods: | 1
| NCLOC: | 15 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
SourceTypeToRuleLanguageMapper.java | - | 100% | 100% | 100% |

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