Package org.sonar.java.model
Class VisitorsBridgeForTests.TestJavaFileScannerContext
- java.lang.Object
-
- org.sonar.java.model.DefaultJavaFileScannerContext
-
- org.sonar.java.model.VisitorsBridgeForTests.TestJavaFileScannerContext
-
- All Implemented Interfaces:
JavaFileScannerContext
- Enclosing class:
- VisitorsBridgeForTests
public static class VisitorsBridgeForTests.TestJavaFileScannerContext extends DefaultJavaFileScannerContext
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sonar.plugins.java.api.JavaFileScannerContext
JavaFileScannerContext.Location
-
-
Constructor Summary
Constructors Constructor Description TestJavaFileScannerContext(CompilationUnitTree tree, File file, SemanticModel semanticModel, SonarComponents sonarComponents, JavaVersion javaVersion, boolean failedParsing)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIssue(int line, JavaCheck javaCheck, String message, Integer cost)Report an issue on a specific line.AnalyzerMessagecreateAnalyzerMessage(JavaCheck javaCheck, Tree startTree, String message)Set<AnalyzerMessage>getIssues()voidreportIssue(AnalyzerMessage message)voidreportIssue(JavaCheck javaCheck, Tree syntaxNode, String message, List<JavaFileScannerContext.Location> secondary, Integer cost)Report an issue.voidreportIssue(JavaCheck javaCheck, Tree startTree, Tree endTree, String message)Report an issue.voidreportIssue(JavaCheck javaCheck, Tree startTree, Tree endTree, String message, List<JavaFileScannerContext.Location> secondary, Integer cost)Report an issue.voidreportIssueWithFlow(JavaCheck javaCheck, Tree syntaxNode, String message, Iterable<List<JavaFileScannerContext.Location>> flows, Integer cost)Report an issue.-
Methods inherited from class org.sonar.java.model.DefaultJavaFileScannerContext
addIssue, addIssue, addIssueOnFile, createAnalyzerMessage, fileParsed, getComplexityNodes, getFile, getFileContent, getFileKey, getFileLines, getJavaVersion, getMethodComplexityNodes, getSemanticModel, getTree, getWorkingDirectory, reportIssue
-
-
-
-
Constructor Detail
-
TestJavaFileScannerContext
public TestJavaFileScannerContext(CompilationUnitTree tree, File file, SemanticModel semanticModel, @Nullable SonarComponents sonarComponents, JavaVersion javaVersion, boolean failedParsing)
-
-
Method Detail
-
getIssues
public Set<AnalyzerMessage> getIssues()
-
addIssue
public void addIssue(int line, JavaCheck javaCheck, String message, @Nullable Integer cost)Description copied from interface:JavaFileScannerContextReport an issue on a specific line.- Specified by:
addIssuein interfaceJavaFileScannerContext- Overrides:
addIssuein classDefaultJavaFileScannerContext- Parameters:
line- line on which to report the issuejavaCheck- The check raising the issue.message- Message to display to the usercost- computed remediation cost if applicable, null if not.
-
reportIssue
public void reportIssue(JavaCheck javaCheck, Tree syntaxNode, String message, List<JavaFileScannerContext.Location> secondary, @Nullable Integer cost)
Description copied from interface:JavaFileScannerContextReport an issue.- Specified by:
reportIssuein interfaceJavaFileScannerContext- Overrides:
reportIssuein classDefaultJavaFileScannerContext- Parameters:
javaCheck- check raising the issuesyntaxNode- syntax node on which to raise the issue.message- Message to display to the user.secondary- List ofJavaFileScannerContext.Locationto display secondary location for the issue.cost- computed remediation cost if applicable, null if not.
-
reportIssue
public void reportIssue(JavaCheck javaCheck, Tree startTree, Tree endTree, String message)
Description copied from interface:JavaFileScannerContextReport an issue.- Specified by:
reportIssuein interfaceJavaFileScannerContext- Overrides:
reportIssuein classDefaultJavaFileScannerContext- Parameters:
javaCheck- check raising the issuestartTree- syntax node on which to start the highlighting of the issue.endTree- syntax node on which to end the highlighting of the issue.message- Message to display to the user.
-
reportIssue
public void reportIssue(JavaCheck javaCheck, Tree startTree, Tree endTree, String message, List<JavaFileScannerContext.Location> secondary, @Nullable Integer cost)
Description copied from interface:JavaFileScannerContextReport an issue.- Specified by:
reportIssuein interfaceJavaFileScannerContext- Overrides:
reportIssuein classDefaultJavaFileScannerContext- Parameters:
javaCheck- check raising the issuestartTree- syntax node on which to start the highlighting of the issue.endTree- syntax node on which to end the highlighting of the issue.message- Message to display to the user.secondary- List ofJavaFileScannerContext.Locationto display secondary location for the issue.cost- computed remediation cost if applicable, null if not.
-
reportIssueWithFlow
public void reportIssueWithFlow(JavaCheck javaCheck, Tree syntaxNode, String message, Iterable<List<JavaFileScannerContext.Location>> flows, @Nullable Integer cost)
Description copied from interface:JavaFileScannerContextReport an issue.- Specified by:
reportIssueWithFlowin interfaceJavaFileScannerContext- Overrides:
reportIssueWithFlowin classDefaultJavaFileScannerContext- Parameters:
javaCheck- check raising the issuesyntaxNode- syntax node on which to raise the issue.message- Message to display to the user.flows- List of list ofJavaFileScannerContext.Locationto display flows for the issue.cost- computed remediation cost if applicable, null if not.
-
reportIssue
public void reportIssue(AnalyzerMessage message)
- Overrides:
reportIssuein classDefaultJavaFileScannerContext
-
createAnalyzerMessage
public AnalyzerMessage createAnalyzerMessage(JavaCheck javaCheck, Tree startTree, String message)
- Overrides:
createAnalyzerMessagein classDefaultJavaFileScannerContext
-
-