Class StubGenerator
java.lang.Object
org.checkerframework.framework.stub.StubGenerator
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
ConstructorsConstructorDescriptionConstructs aStubGeneratorthat outputs toSystem.out.Constructs aStubGeneratorthat outputs to the provided output stream.StubGenerator(PrintStream out) Constructs aStubGeneratorthat outputs to the provided output stream. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidThe main entry point to StubGenerator.voidstubFromField(Element elt) Prints the stub declaration of the given field.voidPrints the stub declaration of the given method or constructor.voidstubFromPackage(PackageElement packageElement) Generates the stub file for all the classes within the provided package.voidstubFromType(TypeElement typeElement) Generates the stub file for the provided class.
-
Constructor Details
-
StubGenerator
public StubGenerator()Constructs aStubGeneratorthat outputs toSystem.out. -
StubGenerator
Constructs aStubGeneratorthat outputs to the provided output stream.- Parameters:
out- the output stream
-
StubGenerator
Constructs aStubGeneratorthat outputs to the provided output stream.- Parameters:
out- the output stream
-
-
Method Details
-
stubFromField
Prints the stub declaration of the given field. Does nothing ifeltis not a field.- Parameters:
elt- a field
-
stubFromPackage
Generates the stub file for all the classes within the provided package.- Parameters:
packageElement- the package whose classes are written to the stub file
-
stubFromMethod
Prints the stub declaration of the given method or constructor. Does nothing ifeltis neither a method nor a constructor.- Parameters:
elt- a method or constructor
-
stubFromType
Generates the stub file for the provided class. The generated file includes the package name.- Parameters:
typeElement- the class to generate a stub file for
-
main
The main entry point to StubGenerator.- Parameters:
args- command-line arguments
-