Package com.arc_e_tect.gradle.apionly.transcriberj.spi


package com.arc_e_tect.gradle.apionly.transcriberj.spi
The emitter interface: how a library adds a dialect to the classes the API-Only TranscriberJ generates.

An emitter is a library that implements Emitter and lists its implementation in META-INF/services/com.arc_e_tect.gradle.apionly.transcriberj.spi.Emitter. A project that wants it adds the library to its transcriberjEmitters configuration; the plugin loads it in a class loader of its own and runs it over the contract model, after the built-in core emitter.

The core emitter decides every class name once, in ClassNames, so that a dialect's companion class and the core class it belongs to always agree.

  • Class
    Description
    What a contract case tests: which response the contract declares for its request, and so what a target must do before the request is sent.
    The core classes of one contract, as the core emitter names them.
    One contract case, as an emitter is given it: the values the generated ContractCase of the base package holds, and the case's index in its operation's CASES.
    A request, as the generated ContractRequest of the same name holds it: the path template and the values that fill it kept apart, and no value encoded.
    One query parameter or header.
    A dialect of generated code: REST Docs descriptors, WireMock stubs, and the like.
    What an emitter is given to write one contract's classes.
    One core class, as the core emitter names it.
    A library generated code needs.
    What a generated class was generated from.
    What an emitter writes, in the mode its options select: the plugin places each kind where it belongs, and refuses a configuration that would put it anywhere else.
    The body of a response an operation declares, as an emitter is given it: the generated class its contract cases name, and the valid bodies that class's requiredBody() and fullBody() return.
    One valid body: its text, or, when the core cannot build one, where and why -- what the generated method throws instead.
    How a project has asked for one contract's classes to be generated.