Class TranscriberJSubscription

java.lang.Object
com.arc_e_tect.gradle.apionly.transcriberj.TranscriberJSubscription
All Implemented Interfaces:
org.gradle.api.Named

public abstract class TranscriberJSubscription extends Object implements org.gradle.api.Named
How the classes for one subscribed contract are generated.

Its name is the contract's name, exactly as the apiOnlySubscriber block subscribes to it.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The description of a class or field the contract does not describe, when descriptions are generated.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the settings for one contract.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.provider.Property<String>
    The package the core classes are generated into.
    abstract org.gradle.api.provider.Property<String>
    The base name of a ResourceBundle the generated classes resolve their descriptions through, such as docs.Descriptions.
    abstract org.gradle.api.provider.Property<String>
    The description of a class or field the contract does not describe, when getGenerateDocs() is on: it says the description is still to come.
    abstract org.gradle.api.file.RegularFileProperty
    The endpoint index the generation writes: the path of every generated operation and inline schema class, keyed ClassName.PATH.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether the generated descriptions come from the contract.
    abstract org.gradle.api.file.DirectoryProperty
    Where the sources are generated.
    abstract org.gradle.api.file.DirectoryProperty
    Where a resource an emitter writes is generated.
    The contract's name.
    abstract org.gradle.api.provider.Property<Integer>
    How many times a recursive reference is followed before the rest of a body is documented as a subsection.
    abstract org.gradle.api.provider.ListProperty<String>
    The source sets the generated classes are compiled with.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_DESCRIPTION_PLACEHOLDER

      public static final String DEFAULT_DESCRIPTION_PLACEHOLDER
      The description of a class or field the contract does not describe, when descriptions are generated.
      See Also:
  • Constructor Details

    • TranscriberJSubscription

      @Inject public TranscriberJSubscription(String name)
      Creates the settings for one contract.
      Parameters:
      name - the contract's name
  • Method Details

    • getName

      public String getName()
      The contract's name.
      Specified by:
      getName in interface org.gradle.api.Named
      Returns:
      the name
    • getBasePackage

      public abstract org.gradle.api.provider.Property<String> getBasePackage()
      The package the core classes are generated into. Required: there is no default.
      Returns:
      the base package
    • getSourceSets

      public abstract org.gradle.api.provider.ListProperty<String> getSourceSets()
      The source sets the generated classes are compiled with.

      Default: test.

      Returns:
      the source set names
    • getRecursionDepth

      public abstract org.gradle.api.provider.Property<Integer> getRecursionDepth()
      How many times a recursive reference is followed before the rest of a body is documented as a subsection.

      Default: 3.

      Returns:
      the depth
    • getGenerateDocs

      public abstract org.gradle.api.provider.Property<Boolean> getGenerateDocs()
      Whether the generated descriptions come from the contract. When they do, a class or field the contract does not describe is reported, and documented with the placeholder.

      Default: false. The class tree is for contract testing; documentation is usually generated elsewhere, from text a technical writer owns.

      Returns:
      the setting
    • getDescriptionPlaceholder

      public abstract org.gradle.api.provider.Property<String> getDescriptionPlaceholder()
      The description of a class or field the contract does not describe, when getGenerateDocs() is on: it says the description is still to come. With it off, every description is the empty string, and this is not used.

      Default: "INTENTIONALLY LEFT BLANK - WILL BE PROVIDED AT A LATER STAGE".

      Returns:
      the placeholder
    • getDescriptionBundle

      public abstract org.gradle.api.provider.Property<String> getDescriptionBundle()
      The base name of a ResourceBundle the generated classes resolve their descriptions through, such as docs.Descriptions. The project owns the text; what generation produced -- the contract's description, or the placeholder -- is the fallback for a key the bundle does not carry.

      Unset by default, and then the generated classes are the ones generated before there were bundles: the text is compiled into them, and nothing is resolved.

      -Dapionly.descriptions.bundle names another bundle for one run, and -Dapionly.descriptions.locale the locale to resolve in, which is what a documentation build rendering several languages from one generated tree uses.

      Returns:
      the bundle's base name
    • getEndpointIndex

      public abstract org.gradle.api.file.RegularFileProperty getEndpointIndex()
      The endpoint index the generation writes: the path of every generated operation and inline schema class, keyed ClassName.PATH. Read-only; it carries the generation task, so a tool reading it runs after the generation.
       doppelgangerApiDetector {
           propertyFiles.from(apiOnlyTranscriberJ.subscriptions.named('orders').flatMap { it.endpointIndex })
       }
       
      Returns:
      the index
    • getInto

      public abstract org.gradle.api.file.DirectoryProperty getInto()
      Where the sources are generated.

      Default: build/generated/sources/transcriberj/<contract>.

      Returns:
      the directory
    • getIntoResources

      public abstract org.gradle.api.file.DirectoryProperty getIntoResources()
      Where a resource an emitter writes is generated.

      Default: build/generated/resources/transcriberj/<contract>.

      Returns:
      the directory