Class JsonApiDocumentReader

java.lang.Object
com.kazforge.jsonapi.jackson3.JsonApiDocumentReader

public final class JsonApiDocumentReader extends Object
Reads JSON:API JSON into a validated JsonApiDocument using an explicit DocumentReadContext.

Decoding is token-driven through public core constructors, then aggregate validation runs before any document is returned. Unknown structural members are discarded on read using the bound validation policy, while recognized standard, extension, allowed-profile, and @ members still decode and validate; aggregate validation of directly constructed models and all writer paths remains strict. Convenience overloads close only parsers they create; caller-owned InputStream and JsonParser instances remain open.

  • Method Summary

    Modifier and Type
    Method
    Description
    com.kazforge.jsonapi.document.DocumentReadContext
    Read context bound to this reader.
    com.kazforge.jsonapi.core.model.JsonApiDocument
    readValue(byte[] utf8Json)
    Reads and validates one JSON:API document from UTF-8 JSON bytes.
    com.kazforge.jsonapi.core.model.JsonApiDocument
    readValue(InputStream utf8Stream)
    Reads from a caller-owned UTF-8 stream.
    com.kazforge.jsonapi.core.model.JsonApiDocument
    Reads and validates one JSON:API document from JSON text.
    com.kazforge.jsonapi.core.model.JsonApiDocument
    readValue(tools.jackson.core.JsonParser parser)
    Reads one JSON:API document from a caller-owned parser starting at the current token (or the next token if none is current).

    Methods inherited from class java.lang.Object

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

    • context

      public com.kazforge.jsonapi.document.DocumentReadContext context()
      Read context bound to this reader.
    • readValue

      public com.kazforge.jsonapi.core.model.JsonApiDocument readValue(String json)
      Reads and validates one JSON:API document from JSON text.
    • readValue

      public com.kazforge.jsonapi.core.model.JsonApiDocument readValue(byte[] utf8Json)
      Reads and validates one JSON:API document from UTF-8 JSON bytes.
    • readValue

      public com.kazforge.jsonapi.core.model.JsonApiDocument readValue(InputStream utf8Stream)
      Reads from a caller-owned UTF-8 stream. The stream is not closed; only the parser created for this call is closed.
    • readValue

      public com.kazforge.jsonapi.core.model.JsonApiDocument readValue(tools.jackson.core.JsonParser parser)
      Reads one JSON:API document from a caller-owned parser starting at the current token (or the next token if none is current). Does not require end-of-input after the document, so callers may sequence multiple root values. The parser is not closed.