Package io.codemodder.providers.sonar
Class SonarPluginJavaParserChanger<T extends com.github.javaparser.ast.Node>
java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.providers.sonar.SonarPluginJavaParserChanger<T>
- All Implemented Interfaces:
io.codemodder.CodeChanger,io.codemodder.FixOnlyCodeChanger
public abstract class SonarPluginJavaParserChanger<T extends com.github.javaparser.ast.Node>
extends io.codemodder.javaparser.JavaParserChanger
implements io.codemodder.FixOnlyCodeChanger
Provides base functionality for making JavaParser-based changes based on Sonar results.
-
Field Summary
Fields inherited from class io.codemodder.javaparser.JavaParserChanger
reporter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSonarPluginJavaParserChanger(RuleIssues ruleIssues, Class<? extends com.github.javaparser.ast.Node> nodeType) protectedSonarPluginJavaParserChanger(RuleIssues ruleIssues, Class<? extends com.github.javaparser.ast.Node> nodeType, io.codemodder.RegionNodeMatcher regionNodeMatcher, io.codemodder.CodemodReporterStrategy codemodReporterStrategy) protectedSonarPluginJavaParserChanger(RuleIssues ruleIssues, Class<? extends com.github.javaparser.ast.Node> nodeType, io.codemodder.RegionNodeMatcher regionNodeMatcher, io.codemodder.NodeCollector nodeCollector) -
Method Summary
Modifier and TypeMethodDescriptionabstract io.codemodder.javaparser.ChangesResultonIssueFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, T node, Issue issue) Creates a visitor for the given context and locations.booleanio.codemodder.CodemodFileScanningResultvisit(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu) Methods inherited from class io.codemodder.javaparser.JavaParserChanger
getDescription, getIndividualChangeDescription, getReferences, getSummaryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.codemodder.FixOnlyCodeChanger
detectorRule
-
Constructor Details
-
SonarPluginJavaParserChanger
protected SonarPluginJavaParserChanger(RuleIssues ruleIssues, Class<? extends com.github.javaparser.ast.Node> nodeType, io.codemodder.RegionNodeMatcher regionNodeMatcher, io.codemodder.NodeCollector nodeCollector) -
SonarPluginJavaParserChanger
protected SonarPluginJavaParserChanger(RuleIssues ruleIssues, Class<? extends com.github.javaparser.ast.Node> nodeType) -
SonarPluginJavaParserChanger
protected SonarPluginJavaParserChanger(RuleIssues ruleIssues, Class<? extends com.github.javaparser.ast.Node> nodeType, io.codemodder.RegionNodeMatcher regionNodeMatcher, io.codemodder.CodemodReporterStrategy codemodReporterStrategy)
-
-
Method Details
-
visit
public io.codemodder.CodemodFileScanningResult visit(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu) - Specified by:
visitin classio.codemodder.javaparser.JavaParserChanger
-
shouldRun
public boolean shouldRun()- Specified by:
shouldRunin interfaceio.codemodder.CodeChanger
-
onIssueFound
public abstract io.codemodder.javaparser.ChangesResult onIssueFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, T node, Issue issue) Creates a visitor for the given context and locations.- Parameters:
context- the context of this files transformationcu- the parsed model of the file being transformednode- the node to act onissue- the given Sonar issue to act on- Returns:
ChangesResult, that contains result changes
-
vendorName
- Specified by:
vendorNamein interfaceio.codemodder.FixOnlyCodeChanger
-