Package io.codemodder.javaparser
Class JavaParserCodemodRunner
java.lang.Object
io.codemodder.javaparser.JavaParserCodemodRunner
- All Implemented Interfaces:
CodemodRunner
This type specializes in non-Java file.
-
Constructor Summary
ConstructorsConstructorDescriptionJavaParserCodemodRunner
(CachingJavaParser parser, JavaParserChanger javaParserChanger, EncodingDetector encodingDetector) -
Method Summary
Modifier and TypeMethodDescriptionrun
(CodemodInvocationContext context) Run the codemod on a single file.boolean
ThePredicate
that determines if this runner supports the given file.
-
Constructor Details
-
JavaParserCodemodRunner
public JavaParserCodemodRunner(CachingJavaParser parser, JavaParserChanger javaParserChanger, EncodingDetector encodingDetector)
-
-
Method Details
-
supports
Description copied from interface:CodemodRunner
ThePredicate
that determines if this runner supports the given file.- Specified by:
supports
in interfaceCodemodRunner
-
run
Description copied from interface:CodemodRunner
Run the codemod on a single file.- Specified by:
run
in interfaceCodemodRunner
- Parameters:
context
- the context for the codemod invocation- Returns:
- an
Optional
representing the file "before and after" the codemod - Throws:
IOException
- if there is an error reading or writing the file
-