View Javadoc

    1   package net.sourceforge.pmd.lang.java.rule;
    2
    3   import net.sourceforge.pmd.Rule;
    4   import net.sourceforge.pmd.RuleContext;
    5   import net.sourceforge.pmd.RuleViolation;
    6   import net.sourceforge.pmd.lang.ast.Node;
    7   import net.sourceforge.pmd.lang.java.ast.JavaNode;
    8   import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory;
    9   import net.sourceforge.pmd.lang.rule.RuleViolationFactory;
    10
    11  public final class JavaRuleViolationFactory extends AbstractRuleViolationFactory {
    12
    13  	public static final RuleViolationFactory INSTANCE = new JavaRuleViolationFactory();
    14
    15  	private JavaRuleViolationFactory() {
    16  	}
    17
    18  	@Override
    19  	protected RuleViolation createRuleViolation(Rule rule, RuleContext ruleContext, Node node, String message) {
    20  		return new JavaRuleViolation(rule, ruleContext, (JavaNode) node, message);
    21  	}
    22
    23  	@Override
    24  	protected RuleViolation createRuleViolation(Rule rule, RuleContext ruleContext, Node node, String message, int beginLine, int endLine) {
    25  		return new JavaRuleViolation(rule, ruleContext, (JavaNode) node, message, beginLine, endLine);
    26  	}
    27
    28  }