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 TypeMethodDescriptionA list of paths patterns requested or rejected by the codemod.boolean
A predicate which dictates if the file should be inspected by the codemod.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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.codemodder.CodeChanger
shouldRun
-
Constructor Details
-
CompositeJavaParserChanger
protected CompositeJavaParserChanger(CodemodReporterStrategy reporterStrategy, JavaParserChanger... changers) -
CompositeJavaParserChanger
-
-
Method Details
-
getIncludesExcludesPattern
Description copied from interface:CodeChanger
A list of paths patterns requested or rejected by the codemod. Those patterns are treated as relative to the repository root. These patterns should follow thePathMatcher
specification. These patterns can be overridden by global patterns.- Specified by:
getIncludesExcludesPattern
in interfaceCodeChanger
- Overrides:
getIncludesExcludesPattern
in classJavaParserChanger
-
supports
Description copied from interface:CodeChanger
A predicate which dictates if the file should be inspected by the codemod. This cannot be overridden and should always pass before executing the codemod.- Specified by:
supports
in interfaceCodeChanger
- Overrides:
supports
in classJavaParserChanger
-
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
-