}
private void recordViolation(final org.sonar.api.resources.File resource,
final SMInputCursor line) throws XMLStreamException {
final Rule rule = Rule.create();
final Violation violation = Violation.create(rule, resource);
// PMD Priorities are 1, 2, 3, 4, 5 RulePriority[0] is INFO
rule.setSeverity(RulePriority.values()[PMD_MINIMUM_PRIORITY
- Integer.valueOf(line.getAttrValue("priority"))]);
rule.setKey(line.getAttrValue("rule"));
rule.setRepositoryKey(OCLintRuleRepository.REPOSITORY_KEY);
violation.setLineId(Integer.valueOf(line.getAttrValue("beginline")));
violation.setMessage(line.getElemStringValue());
foundViolations.add(violation);
}