Interface JsonApiDocuments


public interface JsonApiDocuments
Level-1 raw/general JSON:API document operations.

Raw document operations stay explicit where inference is unsafe: callers supply the semantic DocumentReadContext (including the primary-data kind) rather than relying on the facade to guess ambiguous document shapes. Writes validate before emission as response/other usage; MappedDocument writes additionally compose sparse-fieldset linkage provenance into validation. Raw create/update request writing stays advanced: ordinary request authoring uses JsonApiResources.writeCreateDocument(Object) and JsonApiResources.writeUpdateDocument(Object, com.kazforge.jsonapi.core.validation.EndpointIdentity).

  • Method Summary

    Modifier and Type
    Method
    Description
    com.kazforge.jsonapi.core.model.JsonApiDocument
    com.kazforge.jsonapi.core.model.JsonApiDocument
    Decodes and validates one document under the given read context.
    write(com.kazforge.jsonapi.core.model.JsonApiDocument document)
    Validates a document as response/other usage, then returns its JSON.
    void
    write(com.kazforge.jsonapi.core.model.JsonApiDocument document, OutputStream out)
    Validates a document as response/other usage, then writes it to the given stream.
    Validates a mapped document as response/other usage against the bound context composed with its sparse-fieldset linkage provenance, then returns its JSON.
    void
    Validates a mapped document as response/other usage against the bound context composed with its sparse-fieldset linkage provenance, then writes it to the given stream.
  • Method Details

    • read

      com.kazforge.jsonapi.core.model.JsonApiDocument read(String json, DocumentReadContext context)
      Decodes and validates one document under the given read context.
    • read

      com.kazforge.jsonapi.core.model.JsonApiDocument read(InputStream json, DocumentReadContext context)
      Stream variant of read(String, DocumentReadContext). The stream is not closed.
    • write

      String write(com.kazforge.jsonapi.core.model.JsonApiDocument document)
      Validates a document as response/other usage, then returns its JSON.
    • write

      void write(com.kazforge.jsonapi.core.model.JsonApiDocument document, OutputStream out)
      Validates a document as response/other usage, then writes it to the given stream. The stream is not closed.
    • write

      String write(MappedDocument mapped)
      Validates a mapped document as response/other usage against the bound context composed with its sparse-fieldset linkage provenance, then returns its JSON.
    • write

      void write(MappedDocument mapped, OutputStream out)
      Validates a mapped document as response/other usage against the bound context composed with its sparse-fieldset linkage provenance, then writes it to the given stream. The stream is not closed.