Package com.kazforge.jsonapi.api
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 TypeMethodDescriptioncom.kazforge.jsonapi.core.model.JsonApiDocumentread(InputStream json, DocumentReadContext context) Stream variant ofread(String, DocumentReadContext).com.kazforge.jsonapi.core.model.JsonApiDocumentread(String json, DocumentReadContext context) 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.voidwrite(com.kazforge.jsonapi.core.model.JsonApiDocument document, OutputStream out) Validates a document as response/other usage, then writes it to the given stream.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.voidwrite(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.
-
Method Details
-
read
Decodes and validates one document under the given read context. -
read
Stream variant ofread(String, DocumentReadContext). The stream is not closed. -
write
Validates a document as response/other usage, then returns its JSON. -
write
Validates a document as response/other usage, then writes it to the given stream. The stream is not closed. -
write
Validates a mapped document as response/other usage against the bound context composed with its sparse-fieldset linkage provenance, then returns its JSON. -
write
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.
-