|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.issue.NoSonarFilter
public class NoSonarFilter
Issue filter used to ignore issues created on lines commented with the tag "NOSONAR".
Plugins, viaBatchExtension
s, must feed this filter by registering the
lines that contain "NOSONAR". Note that filters are disabled for the issues reported by
end-users from UI or web services.
Constructor Summary | |
---|---|
NoSonarFilter()
|
Method Summary | |
---|---|
boolean |
accept(Issue issue,
IssueFilterChain chain)
The accept method is called for each Issue created during analysis, to check if it has to be persisted. |
NoSonarFilter |
addComponent(String componentKey,
Set<Integer> noSonarLines)
Deprecated. since 5.0 use noSonarInFile(InputFile, Set) |
NoSonarFilter |
noSonarInFile(InputFile inputFile,
Set<Integer> noSonarLines)
Register lines in a file that contains the NOSONAR flag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NoSonarFilter()
Method Detail |
---|
@Deprecated public NoSonarFilter addComponent(String componentKey, Set<Integer> noSonarLines)
noSonarInFile(InputFile, Set)
public NoSonarFilter noSonarInFile(InputFile inputFile, Set<Integer> noSonarLines)
inputFile
- noSonarLines
- Line number starts at 1 in a filepublic boolean accept(Issue issue, IssueFilterChain chain)
IssueFilter
accept
method is called for each Issue
created during analysis, to check if it has to be persisted. Examples of use cases are:
//NOSONAR
comments, semantic annotations)chain
parameter allows for fine control of the filtering logic: it is each filter's duty to either pass the issue to the next filter, by calling
the IssueFilterChain.accept(org.sonar.api.issue.Issue)
method, or return directly if the issue has to be accepted or not
accept
in interface IssueFilter
issue
- the issue being filteredchain
- the rest of the filters
true
to accept the issue, false
to reject it, IssueFilterChain.accept(org.sonar.api.issue.Issue)
to let the other filters decide.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |