Interface Emitter
public interface Emitter
A dialect of generated code: REST Docs descriptors, WireMock stubs, and the like.
Implementations need a public no-argument constructor, as ServiceLoader
requires, and must not keep state between calls to emit(EmitterContext).
-
Method Summary
Modifier and TypeMethodDescriptionThe libraries the generated code needs, which the plugin adds to the source sets it generates into when the project does not declare them itself.voidemit(EmitterContext context) Writes this emitter's classes for one contract.id()The emitter's identifier: lower case, such asrestdocs.The classified constructs this emitter represents in full.
-
Method Details
-
id
String id()The emitter's identifier: lower case, such asrestdocs. It names the package its companion classes go in, under the base package.- Returns:
- the identifier
-
dependencies
List<ManagedDependency> dependencies()The libraries the generated code needs, which the plugin adds to the source sets it generates into when the project does not declare them itself.- Returns:
- the dependencies; empty when the generated code needs none
-
represents
The classified constructs this emitter represents in full. For any other construct in a class, the emitter writes the affected method withEmitterContext.degraded(String, String, com.arc_e_tect.gradle.apionly.transcriberj.model.Finding).- Returns:
- the constructs represented
-
emit
Writes this emitter's classes for one contract.- Parameters:
context- the contract, the settings, the class names and where to write
-