Interface MessagesToHtmlWriter.Serializer

Enclosing class:
MessagesToHtmlWriter
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface MessagesToHtmlWriter.Serializer
Serializes a message to JSON.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    writeValue(Writer writer, io.cucumber.messages.types.Envelope value)
    Serialize a message to JSON and write it to the given writer.
  • Method Details

    • writeValue

      void writeValue(Writer writer, io.cucumber.messages.types.Envelope value) throws IOException
      Serialize a message to JSON and write it to the given writer.
      • Values must be included unless their value is null or an "absent" reference values such as empty optionals.
      • Enums must be written as strings.
      • The solidus / may not be escaped. Writing json into the html context is handled in this implementation.
      • Implementations may not close the writer after writing a value.
      Parameters:
      writer - to write to
      value - to serialize
      Throws:
      IOException - if anything goes wrong