org.jboss.resteasy.core
Class ServerResponse

java.lang.Object
  extended by javax.ws.rs.core.Response
      extended by org.jboss.resteasy.core.ServerResponse

public class ServerResponse
extends Response

Version:
$Revision: 1 $
Author:
Bill Burke

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.ws.rs.core.Response
Response.ResponseBuilder, Response.Status, Response.StatusType
 
Field Summary
protected  java.lang.annotation.Annotation[] annotations
           
protected  java.lang.Object entity
           
protected  java.lang.reflect.Type genericType
           
protected  MessageBodyWriterInterceptor[] messageBodyWriterInterceptors
           
protected  Headers<java.lang.Object> metadata
           
protected  PostProcessInterceptor[] postProcessInterceptors
           
protected  int status
           
 
Constructor Summary
ServerResponse()
           
ServerResponse(java.lang.Object entity, int status, Headers<java.lang.Object> metadata)
           
 
Method Summary
static ServerResponse copyIfNotServerResponse(Response response)
           
 java.lang.annotation.Annotation[] getAnnotations()
           
 java.lang.Object getEntity()
          Return the response entity.
 java.lang.reflect.Type getGenericType()
           
 MessageBodyWriterInterceptor[] getMessageBodyWriterInterceptors()
           
 MultivaluedMap<java.lang.String,java.lang.Object> getMetadata()
          Get metadata associated with the response as a map.
 PostProcessInterceptor[] getPostProcessInterceptors()
           
 int getStatus()
          Get the status code associated with the response.
 void outputHeaders(HttpResponse response)
           
 MediaType resolveContentType()
           
 void setAnnotations(java.lang.annotation.Annotation[] annotations)
           
 void setEntity(java.lang.Object entity)
           
 void setGenericType(java.lang.reflect.Type genericType)
           
 void setMessageBodyWriterInterceptors(MessageBodyWriterInterceptor[] messageBodyWriterInterceptors)
           
 void setMetadata(MultivaluedMap<java.lang.String,java.lang.Object> metadata)
           
 void setPostProcessInterceptors(PostProcessInterceptor[] postProcessInterceptors)
           
 void setStatus(int status)
           
 void writeTo(HttpResponse response, ResteasyProviderFactory providerFactory)
           
 
Methods inherited from class javax.ws.rs.core.Response
created, fromResponse, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, temporaryRedirect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entity

protected java.lang.Object entity

status

protected int status

metadata

protected Headers<java.lang.Object> metadata

annotations

protected java.lang.annotation.Annotation[] annotations

genericType

protected java.lang.reflect.Type genericType

postProcessInterceptors

protected PostProcessInterceptor[] postProcessInterceptors

messageBodyWriterInterceptors

protected MessageBodyWriterInterceptor[] messageBodyWriterInterceptors
Constructor Detail

ServerResponse

public ServerResponse(java.lang.Object entity,
                      int status,
                      Headers<java.lang.Object> metadata)

ServerResponse

public ServerResponse()
Method Detail

copyIfNotServerResponse

public static ServerResponse copyIfNotServerResponse(Response response)

getMessageBodyWriterInterceptors

public MessageBodyWriterInterceptor[] getMessageBodyWriterInterceptors()

setMessageBodyWriterInterceptors

public void setMessageBodyWriterInterceptors(MessageBodyWriterInterceptor[] messageBodyWriterInterceptors)

getPostProcessInterceptors

public PostProcessInterceptor[] getPostProcessInterceptors()

setPostProcessInterceptors

public void setPostProcessInterceptors(PostProcessInterceptor[] postProcessInterceptors)

getEntity

public java.lang.Object getEntity()
Description copied from class: Response
Return the response entity. The response will be serialized using a MessageBodyWriter for either the class of the entity or, in the case of GenericEntity, the value of GenericEntity.getRawType().

Specified by:
getEntity in class Response
Returns:
an object instance or null if there is no entity
See Also:
MessageBodyWriter

getStatus

public int getStatus()
Description copied from class: Response
Get the status code associated with the response.

Specified by:
getStatus in class Response
Returns:
the response status code or -1 if the status was not set.

getMetadata

public MultivaluedMap<java.lang.String,java.lang.Object> getMetadata()
Description copied from class: Response
Get metadata associated with the response as a map. The returned map may be subsequently modified by the JAX-RS runtime. Values will be serialized using a 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.

Specified by:
getMetadata in class Response
Returns:
response metadata as a map

setEntity

public void setEntity(java.lang.Object entity)

setStatus

public void setStatus(int status)

setMetadata

public void setMetadata(MultivaluedMap<java.lang.String,java.lang.Object> metadata)

getAnnotations

public java.lang.annotation.Annotation[] getAnnotations()

setAnnotations

public void setAnnotations(java.lang.annotation.Annotation[] annotations)

getGenericType

public java.lang.reflect.Type getGenericType()

setGenericType

public void setGenericType(java.lang.reflect.Type genericType)

writeTo

public void writeTo(HttpResponse response,
                    ResteasyProviderFactory providerFactory)
             throws WriterException
Throws:
WriterException

resolveContentType

public MediaType resolveContentType()

outputHeaders

public void outputHeaders(HttpResponse response)


Copyright © 2010. All Rights Reserved.