Package io.codemodder

Interface CodemodInvocationContext


public interface CodemodInvocationContext
The context we provide to each codemod.
  • Method Summary

    Modifier and Type
    Method
    Description
    The root directory where the project being transformed lives.
    The ID of the codemod changing the file.
    The original contents of the file before this codemod
    The includes/excludes for the file being changed.
    default Stream<Line>
    Convenience method for stream-wise processing lines of the file being changed with line numbers.
    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
    • 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