Class Generation
java.lang.Object
com.arc_e_tect.gradle.apionly.transcriberj.core.Generation
One generation run: a contract in, a tree of Java sources out.
The core emitter runs first; then every other emitter, in the order given, over the same model and the same class names.
-
Method Summary
Modifier and TypeMethodDescriptionstatic GenerationReportrun(Path contract, String contractVersion, String contractSha256, Settings settings, Path outputDirectory, List<Emitter> emitters, Path endpointIndex) Generates one contract's sources, replacing whatever the output directory held.static GenerationReportrun(Path contract, Path asyncContract, String contractVersion, String contractSha256, Settings settings, Path outputDirectory, List<Emitter> emitters, Path endpointIndex) Generates one contract's sources from both of its documents.
-
Method Details
-
run
public static GenerationReport run(Path contract, String contractVersion, String contractSha256, Settings settings, Path outputDirectory, List<Emitter> emitters, Path endpointIndex) Generates one contract's sources, replacing whatever the output directory held.- Parameters:
contract- the fetched contract documentcontractVersion- the version the build locked the contract atcontractSha256- the SHA-256 the build locked the document atsettings- how the project asked for the classesoutputDirectory- where the sources goemitters- the emitters to run after the core emitterendpointIndex- where to write the path of every operation class and inline schema class, keyedClassName.PATH, for tools that read test sources without a classpath;nullto write none- Returns:
- what could not be generated in full
- Throws:
GenerationException- when no sources can be generated from the contract
-
run
public static GenerationReport run(Path contract, Path asyncContract, String contractVersion, String contractSha256, Settings settings, Path outputDirectory, List<Emitter> emitters, Path endpointIndex) Generates one contract's sources from both of its documents.They are read into one model, so a fragment both use -- a username in a response and in an event payload -- is one component, and one class.
- Parameters:
contract- the fetched OpenAPI documentasyncContract- the fetched AsyncAPI document, ornullwhen the contract has nonecontractVersion- the version the build locked the contract atcontractSha256- the SHA-256 the build locked the document atsettings- how the project asked for the classesoutputDirectory- where the sources goemitters- the emitters to run after the core emitterendpointIndex- where to write the path of every operation class and inline schema class, keyedClassName.PATH, for tools that read test sources without a classpath;nullto write none- Returns:
- what could not be generated in full
- Throws:
GenerationException- when no sources can be generated from the contract
-