Class JavaStubifier


  • public class JavaStubifier
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      JavaStubifier()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.nio.file.Path dirnameToPath​(java.lang.String dir)
      Converts a directory name to a path.
      static void main​(java.lang.String[] args)
      Processes each provided command-line argument; see class documentation for details.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaStubifier

        public JavaStubifier()
    • Method Detail

      • main

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

        public static java.nio.file.Path dirnameToPath​(java.lang.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.

        Parameters:
        dir - a directory name
        Returns:
        a path for the directory name