Create system to declare processing stages in an extensible fashion

This commit is contained in:
Clément Fournier
2018-11-01 18:53:18 +01:00
parent efc22da116
commit 5eb1d23a38
27 changed files with 578 additions and 63 deletions

View File

@ -4,21 +4,23 @@
package net.sourceforge.pmd.lang.python;
import net.sourceforge.pmd.lang.AbstractLanguageVersionHandler;
import net.sourceforge.pmd.lang.AbstractCpdLanguageVersionHandler;
import net.sourceforge.pmd.lang.Parser;
import net.sourceforge.pmd.lang.ParserOptions;
import net.sourceforge.pmd.lang.rule.RuleViolationFactory;
/**
* Implementation of LanguageVersionHandler for the Python Language.
*/
public class PythonHandler extends AbstractLanguageVersionHandler {
public class PythonHandler extends AbstractCpdLanguageVersionHandler {
@Override
public RuleViolationFactory getRuleViolationFactory() {
throw new UnsupportedOperationException("getRuleViolationFactory() is not supported for Python");
protected String getLanguageName() {
return "Python";
}
@Override
public Parser getParser(ParserOptions parserOptions) {
return new PythonParser(parserOptions);