1 package net.sourceforge.pmd; 2 3 import java.util.Map ; 4 5 import net.sourceforge.pmd.util.CollectionUtil; 6 7 12 public class SourceTypeToRuleLanguageMapper { 13 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 private SourceTypeToRuleLanguageMapper() {}; 25 31 public static Language getMappedLanguage(SourceType sourceType) { 32 return (Language) mapSourceTypeOnRuleLanguage.get(sourceType); 33 } 34 } 35 | Popular Tags |