Class StubGenerator


  • public class StubGenerator
    extends java.lang.Object
    Generates a stub file from a single class or an entire package.

    TODO: StubGenerator needs to be reimplemented, because it no longer works due to changes in JDK 9.

    See the Checker Framework Manual:
    Using stub classes
    • Constructor Summary

      Constructors 
      Constructor Description
      StubGenerator()
      Constructs a StubGenerator that outputs to System.out.
      StubGenerator​(java.io.OutputStream out)
      Constructs a StubGenerator that outputs to the provided output stream.
      StubGenerator​(java.io.PrintStream out)
      Constructs a StubGenerator that outputs to the provided output stream.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      The main entry point to StubGenerator.
      void stubFromField​(javax.lang.model.element.Element elt)
      Generate the stub file for all the classes within the provided package.
      void stubFromMethod​(javax.lang.model.element.ExecutableElement elt)
      Generate the stub file for all the classes within the package that contains elt.
      void stubFromPackage​(javax.lang.model.element.PackageElement packageElement)
      Generate the stub file for all the classes within the provided package.
      void stubFromType​(javax.lang.model.element.TypeElement typeElement)
      Generate the stub file for provided class.
      • Methods inherited from class java.lang.Object

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

      • StubGenerator

        public StubGenerator()
        Constructs a StubGenerator that outputs to System.out.
      • StubGenerator

        public StubGenerator​(java.io.PrintStream out)
        Constructs a StubGenerator that outputs to the provided output stream.
        Parameters:
        out - the output stream
      • StubGenerator

        public StubGenerator​(java.io.OutputStream out)
        Constructs a StubGenerator that outputs to the provided output stream.
        Parameters:
        out - the output stream
    • Method Detail

      • stubFromField

        public void stubFromField​(javax.lang.model.element.Element elt)
        Generate the stub file for all the classes within the provided package.
      • stubFromPackage

        public void stubFromPackage​(javax.lang.model.element.PackageElement packageElement)
        Generate the stub file for all the classes within the provided package.
      • stubFromMethod

        public void stubFromMethod​(javax.lang.model.element.ExecutableElement elt)
        Generate the stub file for all the classes within the package that contains elt.
        Parameters:
        elt - a method or constructor; generate stub files for its package
      • stubFromType

        public void stubFromType​(javax.lang.model.element.TypeElement typeElement)
        Generate the stub file for provided class. The generated file includes the package name.
      • main

        public static void main​(java.lang.String[] args)
        The main entry point to StubGenerator.
        Parameters:
        args - command-line arguments