1 package org.incava.analysis; 2 3 import net.sourceforge.pmd.ast.Token; 4 import org.incava.text.Location; 5 6 7 10 public class Analyzer 11 { 12 15 private Report report; 16 17 22 public Analyzer(Report r) 23 { 24 report = r; 25 } 26 27 33 public void addViolation(String message, Token token) 34 { 35 tr.Ace.log("adding violation for " + token + ", " + message); 36 report.addViolation(new Violation(message, token)); 37 } 38 39 46 public void addViolation(String message, Token firstToken, Token lastToken) 47 { 48 tr.Ace.log("adding violation for " + firstToken + ", " + message); 49 report.addViolation(new Violation(message, firstToken, lastToken)); 50 } 51 52 59 public void addViolation(String message, Location start, Location end) 60 { 61 tr.Ace.log("adding violation for " + message + ", " + start + ", " + end); 62 report.addViolation(new Violation(message, start.line, start.column, end.line, end.column)); 63 } 64 65 74 public void addViolation(String message, int beginLine, int beginColumn, int endLine, int endColumn) 75 { 76 tr.Ace.log("adding violation for " + message + ", " + beginLine + ":" + beginColumn + ", " + endLine + ":" + endColumn); 77 report.addViolation(new Violation(message, beginLine, beginColumn, endLine, endColumn)); 78 } 79 80 83 protected Report getReport() 84 { 85 return report; 86 } 87 88 } 89 | Popular Tags |