public static class VisitorsBridgeForTests.TestJavaFileScannerContext extends DefaultJavaFileScannerContext
JavaFileScannerContext.Location| Constructor and Description |
|---|
TestJavaFileScannerContext(CompilationUnitTree tree,
File file,
SemanticModel semanticModel,
SonarComponents sonarComponents,
JavaVersion javaVersion,
boolean failedParsing) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIssue(int line,
JavaCheck javaCheck,
String message,
Integer cost)
Report an issue on a specific line.
|
Set<AnalyzerMessage> |
getIssues() |
void |
reportIssue(JavaCheck javaCheck,
Tree syntaxNode,
String message,
List<JavaFileScannerContext.Location> secondary,
Integer cost)
Report an issue.
|
void |
reportIssue(JavaCheck javaCheck,
Tree startTree,
Tree endTree,
String message)
Report an issue.
|
void |
reportIssue(JavaCheck javaCheck,
Tree startTree,
Tree endTree,
String message,
List<JavaFileScannerContext.Location> secondary,
Integer cost)
Report an issue.
|
void |
reportIssueWithFlow(JavaCheck javaCheck,
Tree syntaxNode,
String message,
Iterable<List<JavaFileScannerContext.Location>> flows,
Integer cost)
Report an issue.
|
addIssue, addIssue, addIssueOnFile, createAnalyzerMessage, fileParsed, getComplexityNodes, getFile, getFileContent, getFileKey, getFileLines, getJavaVersion, getMethodComplexityNodes, getSemanticModel, getTree, reportIssuepublic TestJavaFileScannerContext(CompilationUnitTree tree, File file, SemanticModel semanticModel, @Nullable SonarComponents sonarComponents, JavaVersion javaVersion, boolean failedParsing)
public Set<AnalyzerMessage> getIssues()
public void addIssue(int line,
JavaCheck javaCheck,
String message,
@Nullable
Integer cost)
JavaFileScannerContextaddIssue in interface JavaFileScannerContextaddIssue in class DefaultJavaFileScannerContextline - 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.JavaFileScannerContext#reportIssue(JavaCheck, Tree, String, List, Integer)} which should be prefered as reporting will be more precise.public void reportIssue(JavaCheck javaCheck, Tree syntaxNode, String message, List<JavaFileScannerContext.Location> secondary, @Nullable Integer cost)
JavaFileScannerContextreportIssue in interface JavaFileScannerContextreportIssue in class DefaultJavaFileScannerContextjavaCheck - check raising the issuesyntaxNode - syntax node on which to raise the issue.message - Message to display to the user.secondary - List of JavaFileScannerContext.Location to display secondary location for the issue.cost - computed remediation cost if applicable, null if not.public void reportIssue(JavaCheck javaCheck, Tree startTree, Tree endTree, String message)
JavaFileScannerContextreportIssue in interface JavaFileScannerContextreportIssue in class DefaultJavaFileScannerContextjavaCheck - 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.public void reportIssue(JavaCheck javaCheck, Tree startTree, Tree endTree, String message, List<JavaFileScannerContext.Location> secondary, @Nullable Integer cost)
JavaFileScannerContextreportIssue in interface JavaFileScannerContextreportIssue in class DefaultJavaFileScannerContextjavaCheck - 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 of JavaFileScannerContext.Location to display secondary location for the issue.cost - computed remediation cost if applicable, null if not.public void reportIssueWithFlow(JavaCheck javaCheck, Tree syntaxNode, String message, Iterable<List<JavaFileScannerContext.Location>> flows, @Nullable Integer cost)
JavaFileScannerContextreportIssueWithFlow in interface JavaFileScannerContextreportIssueWithFlow in class DefaultJavaFileScannerContextjavaCheck - check raising the issuesyntaxNode - syntax node on which to raise the issue.message - Message to display to the user.flows - List of list of JavaFileScannerContext.Location to display flows for the issue.cost - computed remediation cost if applicable, null if not.Copyright © 2012–2017 SonarSource. All rights reserved.