Package io.codemodder

Class RegexFileChanger

java.lang.Object
io.codemodder.RawFileChanger
io.codemodder.RegexFileChanger
All Implemented Interfaces:
CodeChanger

public abstract class RegexFileChanger extends RawFileChanger
This type does the heavy lifting for many protections that can work in a simple "search-and-replace" pattern for non-Java code.
  • Constructor Details

  • Method Details

    • visitFile

      Description copied from class: RawFileChanger
      Visit a file. It is up to the subtype to make sure the file is something to be changed and perform all the changing.
      Specified by:
      visitFile in class RawFileChanger
      Returns:
      a list of changes that were made to the file
      Throws:
      IOException
    • getReplacementFor

      public abstract String getReplacementFor(String matchingSnippet)
      Given a snippet that matches the regex, return the replacement string. Some weavers will just delete the snippet, others will wrap it in something, etc.