View Javadoc
1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.plsql.rule;
5   
6   import net.sourceforge.pmd.Rule;
7   import net.sourceforge.pmd.RuleContext;
8   import net.sourceforge.pmd.RuleViolation;
9   import net.sourceforge.pmd.lang.ast.Node;
10  import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory;
11  import net.sourceforge.pmd.lang.rule.ParametricRuleViolation;
12  import net.sourceforge.pmd.lang.rule.RuleViolationFactory;
13  
14  public final class PLSQLRuleViolationFactory extends AbstractRuleViolationFactory {
15  
16      public static final RuleViolationFactory INSTANCE = new PLSQLRuleViolationFactory();
17  
18      private PLSQLRuleViolationFactory() {
19      }
20  
21      @Override
22      protected RuleViolation createRuleViolation(Rule rule, RuleContext ruleContext, Node node, String message) {
23      	return new ParametricRuleViolation<>(rule, ruleContext, node, message);
24      }
25      
26      protected RuleViolation createRuleViolation(Rule rule, RuleContext ruleContext, Node node, String message, int beginLine, int endLine) {
27          ParametricRuleViolation<Node> violation = new ParametricRuleViolation<>(rule, ruleContext, node, message);
28          violation.setLines(beginLine, endLine);
29  		return violation;
30  	}
31  }
32  
33