Class WriteReport

java.lang.Object
dev.omnist.codec.WriteReport

public class WriteReport extends Object
Accumulates the format.* adjustments (omnist-spec §8.3.8) a codec's writer made while serializing a document that couldn't be represented exactly in the target format. Mutable during a single write call; callers get an immutable snapshot via adjustments().
  • Constructor Details

    • WriteReport

      public WriteReport()
  • Method Details

    • add

      public void add(String path, String code, String message, String severity)
      Records a single adjustment.
      Parameters:
      path - the Document path of the affected leaf, e.g. "$.a.b"
      code - the namespaced diagnostic code, e.g. format.null-unrepresentable
      message - a human-readable description of the adjustment
      severity - "warning" or "error" per §8.3.8's table
    • addAll

      public void addAll(List<WriteAdjustment> other)
      Appends every adjustment from other to this report, preserving order.
    • adjustments

      public List<WriteAdjustment> adjustments()
      Returns an immutable snapshot of every adjustment recorded so far, in the order they were added.
    • toString

      public String toString()
      Overrides:
      toString in class Object