use of net.sourceforge.pmd.lang.LanguageVersionHandler in project Gargoyle by callakrsos.
the class PMDUtil method getSupportedLanguageVersions.
/**
* 지원가능한 PMD Language를 리턴.
*
* @작성자 : KYJ
* @작성일 : 2016. 10. 4.
* @return
*/
public static LanguageVersion[] getSupportedLanguageVersions() {
List<LanguageVersion> languageVersions = new ArrayList<>();
for (LanguageVersion languageVersion : LanguageRegistry.findAllVersions()) {
LanguageVersionHandler languageVersionHandler = languageVersion.getLanguageVersionHandler();
if (languageVersionHandler != null) {
Parser parser = languageVersionHandler.getParser(languageVersionHandler.getDefaultParserOptions());
if (parser != null && parser.canParse()) {
languageVersions.add(languageVersion);
LOGGER.debug("support parser: {}", parser.toString());
} else {
LOGGER.debug("not support parser: {}", parser.toString());
}
} else {
LOGGER.debug("not support parser (handler is null): {}", languageVersion.toString());
}
}
return languageVersions.toArray(new LanguageVersion[languageVersions.size()]);
}
Aggregations