ContentNegotiationServiceForRestfulObjectsV1_0

Returns representations according to theRestful Objectsspec.

API

ContentNegotiationServiceForRestfulObjectsV1_0.java
class ContentNegotiationServiceForRestfulObjectsV1_0 {
  ContentNegotiationServiceForRestfulObjectsV1_0(CausewayConfiguration configuration, SpecificationLoader specificationLoader, ResponseFactory responseFactory)
  ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ManagedObject objectAdapter)
  ResponseEntity<Object> buildResponseTo(IResourceContext resourceContext, ManagedObject objectAdapter, JsonRepresentation representationIfAnyRequired, JsonRepresentation rootRepresentation, MediaType mediaTypeOverride)     (1)
  ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ManagedProperty objectAndProperty)
  ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ManagedCollection objectAndCollection)
  ResponseEntity<Object> buildResponseTo(IResourceContext resourceContext, ManagedCollection objectAndCollection, JsonRepresentation representation, JsonRepresentation rootRepresentation, MediaType mediaTypeOverride)     (2)
  ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ManagedAction objectAndAction)
  ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ObjectAndActionInvocation objectAndActionInvocation)
  ResponseEntity<Object> buildResponseTo(IResourceContext resourceContext, ObjectAndActionInvocation objectAndActionInvocation, JsonRepresentation representation, JsonRepresentation rootRepresentation, MediaType mediaTypeOverride)     (3)
}

Members

buildResponseTo(IResourceContext, ManagedObject, JsonRepresentation, JsonRepresentation, MediaType)

Not API

buildResponseTo(IResourceContext, ManagedCollection, JsonRepresentation, JsonRepresentation, MediaType)

Not API

buildResponseTo(IResourceContext, ObjectAndActionInvocation, JsonRepresentation, JsonRepresentation, MediaType)

Not API

Extensions

One extension (specific to Apache Causeway, not part of the RO spec) is that actions can also be invoked with an HTTP Accept header of the form:

application/json;profile=urn:org.restfulobjects:repr-types/object

If the action result returns a collection then this will automatically converted to a DomainObjectList view model. This can be useful for generic viewers.