ContentNegotiationService
Generates a representation according to HTTP Accept header of the request.
This idea is discussed in section 34.1 of theRestful Objects specv1.0.
The principal motivation is to allow more flexible representations to be generated for REST clients that (perhaps through their use of a certain JavaScript library, say) expect, or at least works best with, a certain style of representation.
API
interface ContentNegotiationService {
ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ManagedObject objectAdapter) (1)
ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ManagedProperty objectAndProperty) (2)
ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ManagedCollection objectAndCollection) (3)
ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ManagedAction objectAndAction) (4)
ResponseEntity<Object> buildResponse(IResourceContext resourceContext, ObjectAndActionInvocation objectAndActionInvocation) (5)
}
| 1 | buildResponse(IResourceContext, ManagedObject)
Returns a representation of a single object. |
| 2 | buildResponse(IResourceContext, ManagedProperty)
Returns a representation of a single property of an object. |
| 3 | buildResponse(IResourceContext, ManagedCollection)
Returns a representation of a single collection of an object. |
| 4 | buildResponse(IResourceContext, ManagedAction)
Returns a representation of a single action (prompt) of an object. |
| 5 | buildResponse(IResourceContext, ObjectAndActionInvocation)
Returns a representation of a single action invocation of an object. |
Members
buildResponse(IResourceContext, ManagedProperty)
Returns a representation of a single property of an object.
buildResponse(IResourceContext, ManagedCollection)
Returns a representation of a single collection of an object.