Package org.sonar.java.checks.helpers
Class QuickFixHelper
java.lang.Object
org.sonar.java.checks.helpers.QuickFixHelper
For internal use only. Can not be used outside SonarJava analyzer.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcontentForRange(SyntaxToken firstToken, SyntaxToken lastToken, JavaFileScannerContext context) static StringcontentForTree(Tree tree, JavaFileScannerContext context) internalContext(JavaFileScannerContext context) newImportSupplier(JavaFileScannerContext context) Check if a given type "requiredType" is available in the current "context".static InternalJavaIssueBuildernewIssue(JavaFileScannerContext context) static SyntaxTokenstatic Optional<VariableTree>nextVariable(VariableTree variable) Returns the following variable in a mutli-variable declaration.static SyntaxTokenpreviousToken(Tree tree) static Optional<VariableTree>previousVariable(VariableTree current) Returns the preceding variable in a mutli-variable declaration.
-
Method Details
-
newIssue
-
internalContext
-
nextToken
-
previousToken
-
previousVariable
Returns the preceding variable in a mutli-variable declaration.- Parameters:
current- The target variable- Returns:
- An Optional with the preceding variable, Optional.empty otherwise.
-
nextVariable
Returns the following variable in a mutli-variable declaration.- Parameters:
variable- The target variable- Returns:
- An Optional with the following variable, Optional.empty otherwise.
-
contentForTree
-
contentForRange
public static String contentForRange(SyntaxToken firstToken, SyntaxToken lastToken, JavaFileScannerContext context) -
newImportSupplier
Check if a given type "requiredType" is available in the current "context". Imports are cached to not have to recompute order all the time. A new import is required if the given type:- is not in the same package of the current compilation unit
- is not yet imported
- Parameters:
context- The context of analysis
-