public class ServerResponse extends Response
Response.ResponseBuilder, Response.Status, Response.StatusType
Modifier and Type | Field and Description |
---|---|
protected Annotation[] |
annotations |
protected Object |
entity |
protected Type |
genericType |
protected boolean |
headersCommitted |
protected MessageBodyWriterInterceptor[] |
messageBodyWriterInterceptors |
protected Headers<Object> |
metadata |
protected PostProcessInterceptor[] |
postProcessInterceptors |
protected Class |
resourceClass |
protected Method |
resourceMethod |
protected int |
status |
Constructor and Description |
---|
ServerResponse() |
ServerResponse(Object entity,
int status,
Headers<Object> metadata) |
Modifier and Type | Method and Description |
---|---|
void |
commitHeaders(HttpResponse response) |
static ServerResponse |
copyIfNotServerResponse(Response response) |
Annotation[] |
getAnnotations() |
Object |
getEntity()
Return the response entity.
|
Type |
getGenericType() |
MessageBodyWriterInterceptor[] |
getMessageBodyWriterInterceptors() |
MultivaluedMap<String,Object> |
getMetadata()
Get metadata associated with the response as a map.
|
PostProcessInterceptor[] |
getPostProcessInterceptors() |
Class |
getResourceClass()
Resource class.
|
Method |
getResourceMethod()
JAX-RS method invoked on.
|
int |
getStatus()
Get the status code associated with the response.
|
MediaType |
resolveContentType() |
void |
setAnnotations(Annotation[] annotations) |
void |
setEntity(Object entity) |
void |
setGenericType(Type genericType) |
void |
setMessageBodyWriterInterceptors(MessageBodyWriterInterceptor[] messageBodyWriterInterceptors) |
void |
setMetadata(MultivaluedMap<String,Object> metadata) |
void |
setPostProcessInterceptors(PostProcessInterceptor[] postProcessInterceptors) |
void |
setResourceClass(Class resourceClass) |
void |
setResourceMethod(Method resourceMethod) |
void |
setStatus(int status) |
void |
writeTo(HttpRequest request,
HttpResponse response,
ResteasyProviderFactory providerFactory)
If there is an entity, headers are not converted to a string and set on the HttpResponse until the output stream is written to.
|
created, fromResponse, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, temporaryRedirect
protected Object entity
protected int status
protected Annotation[] annotations
protected Type genericType
protected PostProcessInterceptor[] postProcessInterceptors
protected MessageBodyWriterInterceptor[] messageBodyWriterInterceptors
protected Method resourceMethod
protected Class resourceClass
protected boolean headersCommitted
public static ServerResponse copyIfNotServerResponse(Response response)
public Method getResourceMethod()
public void setResourceMethod(Method resourceMethod)
public Class getResourceClass()
public void setResourceClass(Class resourceClass)
public MessageBodyWriterInterceptor[] getMessageBodyWriterInterceptors()
public void setMessageBodyWriterInterceptors(MessageBodyWriterInterceptor[] messageBodyWriterInterceptors)
public PostProcessInterceptor[] getPostProcessInterceptors()
public void setPostProcessInterceptors(PostProcessInterceptor[] postProcessInterceptors)
public Object getEntity()
Response
GenericEntity
, the value of GenericEntity.getRawType()
.getEntity
in class Response
MessageBodyWriter
public int getStatus()
Response
public MultivaluedMap<String,Object> getMetadata()
Response
RuntimeDelegate.HeaderDelegate
if one is available via
RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the class of the value or using the values toString
method if a
header delegate is not available.getMetadata
in class Response
public void setEntity(Object entity)
public void setStatus(int status)
public void setMetadata(MultivaluedMap<String,Object> metadata)
public Annotation[] getAnnotations()
public void setAnnotations(Annotation[] annotations)
public Type getGenericType()
public void setGenericType(Type genericType)
public void writeTo(HttpRequest request, HttpResponse response, ResteasyProviderFactory providerFactory) throws WriterException
request
- response
- providerFactory
- WriterException
public MediaType resolveContentType()
public void commitHeaders(HttpResponse response)
Copyright © 2018 JBoss by Red Hat. All rights reserved.