Class StubGenerator

java.lang.Object
org.checkerframework.framework.stub.StubGenerator

public class StubGenerator extends 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 Details

    • StubGenerator

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

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

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

    • stubFromField

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

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

      public void stubFromMethod(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(TypeElement typeElement)
      Generate the stub file for provided class. The generated file includes the package name.
    • main

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