@Service @Named(value="isisRoRendering.ContentNegotiationServiceXRoDomainType") @Order(value=-100) @Qualifier(value="XRoDomainType") public class ContentNegotiationServiceXRoDomainType extends ContentNegotiationServiceAbstract
application/json or application/xmland specifying an x-ro-domain-type; will delegate to
any available ContentMappingServices to (try to) map the result object into the required representation if possible.
In the accept header the profile is also checked dependent on the resource being invoked; either profile="urn:org.restfulobjects:repr-types/object" for an object representation, or profile="profile=urn:org.restfulobjects:repr-types/action-result" for an action result.
If the accept header specifies application/xml then the service additionally verifies that the (mapped) domain object's
runtime type is annotated with the JAXB XmlRootElement annotation so that RestEasy is able to
unambiguously serialize it.
| Modifier and Type | Field and Description |
|---|---|
static String |
X_RO_DOMAIN_TYPE |
| Constructor and Description |
|---|
ContentNegotiationServiceXRoDomainType() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response.ResponseBuilder |
buildResponse(IResourceContext renderContext,
org.apache.isis.core.metamodel.spec.ManagedObject objectAdapter)
search for an accept header in form
application/xml;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=todoapp.dto.module.todoitem.ToDoItemDto |
javax.ws.rs.core.Response.ResponseBuilder |
buildResponse(IResourceContext renderContext,
ObjectAndActionInvocation objectAndActionInvocation)
search for an accept header in form
application/xml;profile=urn:org.restfulobjects:repr-types/action-result;x-ro-domain-type=todoapp.dto.module.todoitem.ToDoItemDto |
protected javax.ws.rs.core.Response.ResponseBuilder |
buildResponse(IResourceContext renderContext,
Object domainObject,
org.apache.isis.viewer.restfulobjects.applib.RepresentationType representationType) |
protected Object |
map(Object domainObject,
List<javax.ws.rs.core.MediaType> acceptableMediaTypes)
Delegates to either the applib
ContentMappingService. |
protected javax.ws.rs.core.MediaType |
mediaTypeFrom(IResourceContext renderContext,
org.apache.isis.viewer.restfulobjects.applib.RepresentationType representationType) |
buildResponse, buildResponse, buildResponse, ensureDomainObjectAssignable, ensureJaxbAnnotated, loadClass, mediaTypeParameterList, mediaTypeParameterMatches, objectOf, returnedObjectOfpublic static final String X_RO_DOMAIN_TYPE
public ContentNegotiationServiceXRoDomainType()
public javax.ws.rs.core.Response.ResponseBuilder buildResponse(IResourceContext renderContext, org.apache.isis.core.metamodel.spec.ManagedObject objectAdapter)
application/xml;profile=urn:org.restfulobjects:repr-types/object;x-ro-domain-type=todoapp.dto.module.todoitem.ToDoItemDtobuildResponse in interface ContentNegotiationServicebuildResponse in class ContentNegotiationServiceAbstractprotected javax.ws.rs.core.MediaType mediaTypeFrom(IResourceContext renderContext, org.apache.isis.viewer.restfulobjects.applib.RepresentationType representationType)
public javax.ws.rs.core.Response.ResponseBuilder buildResponse(IResourceContext renderContext, ObjectAndActionInvocation objectAndActionInvocation)
application/xml;profile=urn:org.restfulobjects:repr-types/action-result;x-ro-domain-type=todoapp.dto.module.todoitem.ToDoItemDtobuildResponse in interface ContentNegotiationServicebuildResponse in class ContentNegotiationServiceAbstractprotected javax.ws.rs.core.Response.ResponseBuilder buildResponse(IResourceContext renderContext, Object domainObject, org.apache.isis.viewer.restfulobjects.applib.RepresentationType representationType)
Copyright © 2010–2020 The Apache Software Foundation. All rights reserved.