Interface JsonApiResources
Reads bind directly to the caller-supplied target type and never require a resource-type
registry. readOne requires primary data that is exactly one resource object;
readCreate requires one resource object validated as a create request; readMany requires
a resource collection. Null, absent, identifier, error, and cross-shape document states are never
silently coerced. The Class overloads cover ordinary DTOs; the Type overloads
cover generic targets whose fidelity genuinely requires a full type. Generic typed-document
envelopes and heterogeneous binding remain advanced.
Writes coordinate mapping, configured decoration, mapped-document validation, and document
emission internally. writeCreateDocument selects core CREATE_REQUEST validation
and writeUpdateDocument selects core UPDATE_REQUEST validation; neither
reimplements core rules. Where the caller has expected-identity context for an update, it is
supplied explicitly as an EndpointIdentity. Operation names express JSON:API semantics
and encode no HTTP transport.
Configured Jackson remains the sole property-naming authority; id and lid stay
independent roles; ordinary relationships stay linkage-oriented with a present data
member. Failures retain the document-read, core validation, and mapping diagnostic families.
-
Method Summary
Modifier and TypeMethodDescription<T> TreadCreate(InputStream json, Class<T> type) Stream variant ofreadCreate(String, Class).readCreate(InputStream json, Type type) Stream variant ofreadCreate(String, Type).<T> TreadCreate(String json, Class<T> type) Reads exactly one primary resource DTO using coreCREATE_REQUESTvalidation.readCreate(String json, Type type) Generic-target variant ofreadCreate(String, Class).<T> List<T> readMany(InputStream json, Class<T> type) Stream variant ofreadMany(String, Class).readMany(InputStream json, Type type) Stream variant ofreadMany(String, Type).<T> List<T> Reads a resource collection.Reads a resource collection using a full generic element type.<T> ResourceCollectionDocument<T> readManyDocument(InputStream json, Class<T> type) Stream variant ofreadManyDocument(String, Class).<T> ResourceCollectionDocument<T> readManyDocument(String json, Class<T> type) Reads a resource collection together with top-level document state.<T> TreadOne(InputStream json, Class<T> type) Stream variant ofreadOne(String, Class).readOne(InputStream json, Type type) Stream variant ofreadOne(String, Type).<T> TReads exactly one resource DTO.Reads exactly one resource DTO using a full generic type.<T> ResourceDocument<T> readOneDocument(InputStream json, Class<T> type) Stream variant ofreadOneDocument(String, Class).<T> ResourceDocument<T> readOneDocument(String json, Class<T> type) Reads one resource DTO together with top-level document state.writeCreateDocument(Object resource) Authors a create-request document for one resource with default options and returns its JSON.writeCreateDocument(Object resource, ResourceWriteOptions options) Authors a create-request document for one resource with the given options and returns its JSON.voidwriteCreateDocument(Object resource, ResourceWriteOptions options, OutputStream out) Authors a create-request document for one resource with the given options to the given stream.voidwriteCreateDocument(Object resource, OutputStream out) Authors a create-request document for one resource with default options to the given stream.Writes a resource collection with default options and returns the JSON document.writeMany(Iterable<?> resources, ResourceWriteOptions options) Writes a resource collection with the given options and returns the JSON document.voidwriteMany(Iterable<?> resources, ResourceWriteOptions options, OutputStream out) Writes a resource collection with the given options to the given stream.voidwriteMany(Iterable<?> resources, OutputStream out) Writes a resource collection with default options to the given stream.Writes one resource with default options and returns the JSON document.writeOne(Object resource, ResourceWriteOptions options) Writes one resource with the given options and returns the JSON document.voidwriteOne(Object resource, ResourceWriteOptions options, OutputStream out) Writes one resource with the given options to the given stream.voidwriteOne(Object resource, OutputStream out) Writes one resource with default options to the given stream.writeUpdateDocument(Object resource, @Nullable com.kazforge.jsonapi.core.validation.EndpointIdentity expectedIdentity) Authors an update-request document for one resource with default options and returns its JSON.writeUpdateDocument(Object resource, @Nullable com.kazforge.jsonapi.core.validation.EndpointIdentity expectedIdentity, ResourceWriteOptions options) Authors an update-request document for one resource with the given options and returns its JSON.voidwriteUpdateDocument(Object resource, @Nullable com.kazforge.jsonapi.core.validation.EndpointIdentity expectedIdentity, ResourceWriteOptions options, OutputStream out) Authors an update-request document for one resource with the given options to the given stream.voidwriteUpdateDocument(Object resource, @Nullable com.kazforge.jsonapi.core.validation.EndpointIdentity expectedIdentity, OutputStream out) Authors an update-request document for one resource with default options to the given stream.
-
Method Details
-
readOne
Reads exactly one resource DTO. Requires single-resource primary data. -
readOne
Stream variant ofreadOne(String, Class). The stream is not closed. -
readOne
Reads exactly one resource DTO using a full generic type. The caller ensurestypedenotesT. -
readOne
Stream variant ofreadOne(String, Type). The stream is not closed. The caller ensurestypedenotes the returned value. -
readCreate
Reads exactly one primary resource DTO using coreCREATE_REQUESTvalidation. The primaryidmay be absent;lidremains independent and may identify a matching primary self-reference. Supplied primary relationships requiredata. The complete document, including included-resource identities and full linkage, is validated before binding;includedis not used to hydrate DTO relationships. Response reads retain their ordinary validation semantics. -
readCreate
Stream variant ofreadCreate(String, Class). The stream is not closed. -
readCreate
Generic-target variant ofreadCreate(String, Class). The caller ensurestypedenotes the returned value. -
readCreate
Stream variant ofreadCreate(String, Type). The stream is not closed. -
readMany
Reads a resource collection. Requires collection primary data; never coerces one resource, null, identifiers, or absent data into a collection. -
readMany
Stream variant ofreadMany(String, Class). The stream is not closed. -
readMany
Reads a resource collection using a full generic element type. The caller ensurestypedenotes the collection element type. -
readMany
Stream variant ofreadMany(String, Type). The stream is not closed. The caller ensurestypedenotes the collection element type. -
readOneDocument
Reads one resource DTO together with top-level document state. Requires single-resource primary data. -
readOneDocument
Stream variant ofreadOneDocument(String, Class). The stream is not closed. -
readManyDocument
Reads a resource collection together with top-level document state. Requires collection primary data. -
readManyDocument
Stream variant ofreadManyDocument(String, Class). The stream is not closed. -
writeOne
Writes one resource with default options and returns the JSON document. -
writeOne
Writes one resource with the given options and returns the JSON document. -
writeOne
Writes one resource with default options to the given stream. The stream is not closed. -
writeOne
Writes one resource with the given options to the given stream. The stream is not closed. -
writeMany
Writes a resource collection with default options and returns the JSON document. -
writeMany
Writes a resource collection with the given options and returns the JSON document. -
writeMany
Writes a resource collection with default options to the given stream. The stream is not closed. -
writeMany
Writes a resource collection with the given options to the given stream. The stream is not closed. -
writeCreateDocument
Authors a create-request document for one resource with default options and returns its JSON. Selects coreCREATE_REQUESTvalidation. -
writeCreateDocument
Authors a create-request document for one resource with the given options and returns its JSON. Selects coreCREATE_REQUESTvalidation. -
writeCreateDocument
Authors a create-request document for one resource with default options to the given stream. The stream is not closed. Selects coreCREATE_REQUESTvalidation. -
writeCreateDocument
Authors a create-request document for one resource with the given options to the given stream. The stream is not closed. Selects coreCREATE_REQUESTvalidation. -
writeUpdateDocument
String writeUpdateDocument(Object resource, @Nullable com.kazforge.jsonapi.core.validation.EndpointIdentity expectedIdentity) Authors an update-request document for one resource with default options and returns its JSON. Selects coreUPDATE_REQUESTvalidation. A nullexpectedIdentitydisables the endpoint-identity comparison. -
writeUpdateDocument
String writeUpdateDocument(Object resource, @Nullable com.kazforge.jsonapi.core.validation.EndpointIdentity expectedIdentity, ResourceWriteOptions options) Authors an update-request document for one resource with the given options and returns its JSON. Selects coreUPDATE_REQUESTvalidation. A nullexpectedIdentitydisables the endpoint-identity comparison. -
writeUpdateDocument
void writeUpdateDocument(Object resource, @Nullable com.kazforge.jsonapi.core.validation.EndpointIdentity expectedIdentity, OutputStream out) Authors an update-request document for one resource with default options to the given stream. The stream is not closed. Selects coreUPDATE_REQUESTvalidation. A nullexpectedIdentitydisables the endpoint-identity comparison. -
writeUpdateDocument
void writeUpdateDocument(Object resource, @Nullable com.kazforge.jsonapi.core.validation.EndpointIdentity expectedIdentity, ResourceWriteOptions options, OutputStream out) Authors an update-request document for one resource with the given options to the given stream. The stream is not closed. Selects coreUPDATE_REQUESTvalidation. A nullexpectedIdentitydisables the endpoint-identity comparison.
-