Package io.codemodder

Class CodemodResources

java.lang.Object
io.codemodder.CodemodResources

public final class CodemodResources extends Object
A utility class for accessing a codemod's resources in it's "default location" the classpath.
  • Method Details

    • getClassResourceAsString

      public static String getClassResourceAsString(Class<?> type, String relativeName)
      Returns a class resource as a String.

      The absolute name of the class resource is of the following form:

      /modifiedPackageName/className/relativeName
      Where the modifiedPackageName is the package name of this object with '/' substituted for '.'.
      Parameters:
      type - The codemod type.
      relativeName - The relative name of the resource.
      Returns:
      The resource as a String.
      Throws:
      MissingResourceException - If the resource was not found.