|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.rules.Violation
public class Violation
A class that represents a violation. A violation happens when a resource does not respect a defined rule.
Constructor Summary | |
---|---|
Violation(Rule rule)
Deprecated. since 2.3. Use the factory method create() |
|
Violation(Rule rule,
Resource resource)
Deprecated. since 2.3. Use the factory method create() |
Method Summary | |
---|---|
static Violation |
create(ActiveRule activeRule,
Resource resource)
|
static Violation |
create(Rule rule,
Resource resource)
|
boolean |
equals(Object obj)
|
Double |
getCost()
|
Integer |
getLineId()
|
String |
getMessage()
|
RulePriority |
getPriority()
|
Resource |
getResource()
|
Rule |
getRule()
|
int |
hashCode()
|
Violation |
setCost(Double d)
The cost to fix a violation can't be precisely computed without this information. |
Violation |
setLineId(Integer lineId)
Sets the violation line |
Violation |
setMessage(String message)
Sets the violation message |
Violation |
setPriority(RulePriority priority)
Deprecated. since 2.3. The priority is set by the quality profile. |
Violation |
setResource(Resource resource)
Sets the resource the violation applies to |
Violation |
setRule(Rule rule)
Sets the rule violated |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
@Deprecated public Violation(Rule rule)
@Deprecated public Violation(Rule rule, Resource resource)
rule
- the rule that has been violatedresource
- the resource the violation should be attached toMethod Detail |
---|
public Resource getResource()
public Violation setResource(Resource resource)
public Rule getRule()
public Violation setRule(Rule rule)
public String getMessage()
public Violation setMessage(String message)
public Integer getLineId()
public Violation setLineId(Integer lineId)
public RulePriority getPriority()
@Deprecated public Violation setPriority(RulePriority priority)
public Double getCost()
setCost()
public Violation setCost(Double d)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public static Violation create(ActiveRule activeRule, Resource resource)
public static Violation create(Rule rule, Resource resource)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |