Class JavaParserChanger

java.lang.Object
io.codemodder.javaparser.JavaParserChanger
All Implemented Interfaces:
CodeChanger
Direct Known Subclasses:
CompositeJavaParserChanger, SarifPluginJavaParserChanger

public abstract class JavaParserChanger extends Object implements CodeChanger
Uses JavaParser to change Java source files.
  • Field Details

  • Constructor Details

    • JavaParserChanger

      public JavaParserChanger()
    • JavaParserChanger

      public JavaParserChanger(CodemodReporterStrategy reporter)
  • Method Details

    • visit

      public abstract CodemodFileScanningResult visit(CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu)
      Called when a Java file, which has already been parsed into a compilation unit, is seen.
    • getSummary

      public String getSummary()
      Description copied from interface: CodeChanger
      The headline for this codemod's changes.
      Specified by:
      getSummary in interface CodeChanger
    • getDescription

      public String getDescription()
      Description copied from interface: CodeChanger
      A deep description of what this codemod's changes.
      Specified by:
      getDescription in interface CodeChanger
    • getIndividualChangeDescription

      public String getIndividualChangeDescription(Path filePath, CodemodChange change)
      Description copied from interface: CodeChanger
      A description of an individual change made by this codemod.
      Specified by:
      getIndividualChangeDescription in interface CodeChanger
    • getIncludesExcludesPattern

      public IncludesExcludesPattern getIncludesExcludesPattern()
      Description copied from interface: CodeChanger
      A list of paths patterns requested or rejected by the codemod. Those patterns are treated as relative to the repository root. These patterns should follow the PathMatcher specification. These patterns can be overridden by global patterns.
      Specified by:
      getIncludesExcludesPattern in interface CodeChanger
    • supports

      public boolean supports(Path file)
      Description copied from interface: CodeChanger
      A predicate which dictates if the file should be inspected by the codemod. This cannot be overridden and should always pass before executing the codemod.
      Specified by:
      supports in interface CodeChanger
    • getReferences

      public List<io.codemodder.codetf.CodeTFReference> getReferences()
      Description copied from interface: CodeChanger
      A list of references for further reading on the issues this codemod addresses or other supplementary information.
      Specified by:
      getReferences in interface CodeChanger