Package io.codemodder
Interface CodemodInvocationContext
public interface CodemodInvocationContext
The context we provide to each codemod.
-
Method Summary
Modifier and TypeMethodDescriptionThe root directory where the project being transformed lives.The ID of the codemod changing the file.contents()
The original contents of the file before this codemodThe list of dependencies that were found at pom fileThe includes/excludes for the file being changed.lines()
Convenience method for stream-wise processing lines of the file being changed with line numbers.path()
The individual file being changed.
-
Method Details
-
lineIncludesExcludes
LineIncludesExcludes lineIncludesExcludes()The includes/excludes for the file being changed. -
codeDirectory
CodeDirectory codeDirectory()The root directory where the project being transformed lives. -
path
Path path()The individual file being changed. -
codemodId
String codemodId()The ID of the codemod changing the file. -
contents
String contents()The original contents of the file before this codemod -
dependencies
Collection<DependencyGAV> dependencies()The list of dependencies that were found at pom file -
lines
Convenience method for stream-wise processing lines of the file being changed with line numbers.- Returns:
Stream
of lines (with indices) of the file being changed. Must be closed.- Throws:
IOException
- when fails to read the file
-