Package io.codemodder
Class CompositeJavaParserChanger
java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.CompositeJavaParserChanger
- All Implemented Interfaces:
CodeChanger
A type that allows composing multiple
JavaParserChanger
instances are under the same
umbrella.
For instance, you might want to have multiple changers, each with their own SARIF collection,
all be reported under the same Codemod.id()
.
-
Field Summary
Fields inherited from class io.codemodder.javaparser.JavaParserChanger
reporter
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CompositeJavaParserChanger
(CodemodReporterStrategy reporterStrategy, JavaParserChanger... changers) protected
CompositeJavaParserChanger
(JavaParserChanger... changers) -
Method Summary
Modifier and TypeMethodDescriptionboolean
A lifecycle event that is called before any files are processed.visit
(CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu) Called when a Java file, which has already been parsed into a compilation unit, is seen.Methods inherited from class io.codemodder.javaparser.JavaParserChanger
getDescription, getIndividualChangeDescription, getReferences, getSummary
-
Constructor Details
-
CompositeJavaParserChanger
protected CompositeJavaParserChanger(CodemodReporterStrategy reporterStrategy, JavaParserChanger... changers) -
CompositeJavaParserChanger
-
-
Method Details
-
visit
public CodemodFileScanningResult visit(CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu) Description copied from class:JavaParserChanger
Called when a Java file, which has already been parsed into a compilation unit, is seen.- Specified by:
visit
in classJavaParserChanger
-
shouldRun
public boolean shouldRun()Description copied from interface:CodeChanger
A lifecycle event that is called before any files are processed. This is a good place to short circuit if you don't have the necessary resources (e.g., SARIF).
-