Class JavaStubifier


public class JavaStubifier extends Object
Process Java source files in a directory to produce, in-place, minimal stub files.

To process a file means to remove:

  1. everything that is private or package-private,
  2. all comments, except for an initial copyright header,
  3. all method bodies,
  4. all field initializers,
  5. all initializer blocks,
  6. attributes to the Deprecated annotation (to be Java 8 compatible).
  • Constructor Details

    • JavaStubifier

      public JavaStubifier()
  • Method Details

    • main

      public static void main(String[] args)
      Processes each provided command-line argument; see class documentation for details.
      args - command-line arguments: directories to process
    • dirnameToPath

      public static Path dirnameToPath(String dir)
      Converts a directory name to a path. It issues a warning and terminates the program if the argument does not exist or is not a directory.

      Unlike Paths.get, it handles "." which means the current directory in Unix.

      dir - a directory name
      a path for the directory name