Class GenerationReport

java.lang.Object
com.arc_e_tect.gradle.apionly.transcriberj.core.GenerationReport

public final class GenerationReport extends Object
What a generation run could not do in full, and what the specification could do about it: the end-of-run report D14 asks for.
  • Constructor Details

    • GenerationReport

      public GenerationReport()
      Creates an empty report.
  • Method Details

    • noValidValue

      public List<GenerationReport.NoValidValue> noValidValue()
      Every generated method that throws because no valid value could be generated for it.
      Returns:
      the entries, in the order they were written
    • unsupportedParameters

      public List<GenerationReport.UnsupportedParameter> unsupportedParameters()
      Every parameter no valid value is generated for yet.
      Returns:
      the entries, in contract order
    • invalidRequestCases

      public int invalidRequestCases()
      How many invalid-request cases were derived.
      Returns:
      the count
    • constraintCoverage

      public Map<String,Integer> constraintCoverage()
      How many constraints on request input have a case, and how many have none, by reason.
      Returns:
      the counts: covered, then each reason's label, in order of first use
    • gaps

      public List<String> gaps()
      The operations that constrain their request input but declare no invalid-request status.
      Returns:
      their locations, in contract order
    • degraded

      public List<GenerationReport.Degraded> degraded()
      Every degraded method.
      Returns:
      the entries, in the order they were written
    • recommendations

      public List<GenerationReport.Recommendation> recommendations()
      Every recommendation.
      Returns:
      the entries, in the order they were made
    • undecided

      public List<Finding> undecided()
      Every construct no generation rule has been decided for.
      Returns:
      the findings, in contract order
    • warnings

      public List<String> warnings()
      Everything about the contract's design worth a second look.
      Returns:
      the warnings, in the order they were found
    • note

      public void note(String note)
      Records something worth saying about this generation that is not a problem.
      Parameters:
      note - the note
    • notes

      public List<String> notes()
      What this generation had to say about itself.
      Returns:
      the notes, in the order they were made
    • render

      public String render(String contract, String version)
      The report as text, for a file and a build log.
      Parameters:
      contract - the contract's name
      version - the contract's version
      Returns:
      the text
    • renderValidValues

      public String renderValidValues(String contract, String version)
      Every generated valid value, by class and location, as JSON: members sorted by name, no insignificant whitespace, and a final newline, so the same contract gives the same bytes.
      Parameters:
      contract - the contract's name
      version - the contract's version
      Returns:
      the JSON text
    • fragment

      public String fragment()
      The report as a fragment one generation task writes, as JSON: what render(java.lang.String, java.lang.String) shows, and nothing else, so that a task that runs one emitter writes only that emitter's part. fromFragment(java.lang.String) reads it back.
      Returns:
      the JSON text, with a final newline
    • fromFragment

      public static GenerationReport fromFragment(String json)
      Reads a fragment fragment() wrote.
      Parameters:
      json - the fragment
      Returns:
      the report it holds
    • add

      public void add(GenerationReport emitter)
      Adds what one emitter reported -- the methods it degraded -- after everything already here, as a run of every emitter in one pass would have.
      Parameters:
      emitter - the emitter's part of a report
    • renderAsciiDoc

      public String renderAsciiDoc(String title)
      The report's findings as an AsciiDoc fragment, included by the frame renderAsciiDocFrame(java.lang.String, java.lang.String, java.util.List<java.lang.String>) writes: one section per kind of finding that has any, each finding shown verbatim, so that nothing a contract says is read as AsciiDoc markup.
      Parameters:
      title - the fragment's heading, such as Core or Emitter restdocs
      Returns:
      the AsciiDoc text
    • renderAsciiDocFrame

      public String renderAsciiDocFrame(String contract, String version, List<String> fragments)
      The frame of the AsciiDoc report: the summary of the whole report, and an include:: of each fragment, in the order given.
      Parameters:
      contract - the contract's name
      version - the contract's version
      fragments - each fragment's path, relative to the frame
      Returns:
      the AsciiDoc text