Package io.codemodder

Interface CodemodInvocationContext


public interface CodemodInvocationContext
The context we provide to each codemod.
  • 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

      default Stream<Line> lines() throws IOException
      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