Usage

The ContentMappingService supports the (default implementation of the) internal ContentNegotiationService SPI enabling the RestfulObjects viewer to represent domain objects in some other format as specified by the HTTP Accept header.

For its part, the (default implementation of the) ContentNegotiationService will check all available implementations of ContentMappingService to convert the domain object to the requested media type, rather than merely the first implementation found; in other words it uses the chain-of-responsibility pattern. Services are checked in the ordering defined by the @jakarta.annotation.Priority annotation. The mapped object used will be the first (= earlies encountered) non-null result returned by an implementation.

This service is a companion to the default implementation of the ContentNegotiationService.

The framework implementations of ContentMappingService use the MetaModelService to lookup any custom implementations of CommandDtoProcessor.