com.sun.jersey.core.spi.factory
Class ResponseImpl

java.lang.Object
  extended by javax.ws.rs.core.Response
      extended by com.sun.jersey.core.spi.factory.ResponseImpl
Direct Known Subclasses:
JResponseAsResponse

public class ResponseImpl
extends Response

An implementation of Response.

This implementation supports the declaration of an entity type that will be utilized when a MessageBodyWriter is selected to write out the entity.

Author:
Paul.Sandoz@Sun.Com

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.ws.rs.core.Response
Response.ResponseBuilder, Response.Status, Response.StatusType
 
Constructor Summary
protected ResponseImpl(int status, OutBoundHeaders headers, java.lang.Object entity, java.lang.reflect.Type entityType)
          Construct given a status, entity and metadata.
protected ResponseImpl(Response.StatusType statusType, OutBoundHeaders headers, java.lang.Object entity, java.lang.reflect.Type entityType)
          Construct given a status type, entity and metadata.
 
Method Summary
 java.lang.Object getEntity()
           
 java.lang.reflect.Type getEntityType()
          Get the entity type.
 MultivaluedMap<java.lang.String,java.lang.Object> getMetadata()
           
 int getStatus()
           
 Response.StatusType getStatusType()
          Get the status type.
static Response.Status.Family toFamilyCode(int statusCode)
           
static Response.StatusType toStatusType(int statusCode)
           
 
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
 

Constructor Detail

ResponseImpl

protected ResponseImpl(Response.StatusType statusType,
                       OutBoundHeaders headers,
                       java.lang.Object entity,
                       java.lang.reflect.Type entityType)
Construct given a status type, entity and metadata.

Parameters:
statusType - the status type
headers - the metadata, it is the callers responsibility to copy the metadata if necessary.
entity - the entity
entityType - the entity type, it is the callers responsibility to ensure the entity type is compatible with the entity.

ResponseImpl

protected ResponseImpl(int status,
                       OutBoundHeaders headers,
                       java.lang.Object entity,
                       java.lang.reflect.Type entityType)
Construct given a status, entity and metadata.

Parameters:
status - the status
headers - the metadata, it is the callers responsibility to copy the metadata if necessary.
entity - the entity
entityType - the entity type, it is the callers responsibility to ensure the entity type is compatible with the entity.
Method Detail

getStatusType

public Response.StatusType getStatusType()
Get the status type.

Returns:
the status type.

getEntityType

public java.lang.reflect.Type getEntityType()
Get the entity type.

Returns:
the entity type.

getStatus

public int getStatus()
Specified by:
getStatus in class Response

getMetadata

public MultivaluedMap<java.lang.String,java.lang.Object> getMetadata()
Specified by:
getMetadata in class Response

getEntity

public java.lang.Object getEntity()
Specified by:
getEntity in class Response

toStatusType

public static Response.StatusType toStatusType(int statusCode)

toFamilyCode

public static Response.Status.Family toFamilyCode(int statusCode)


Copyright © 2010 Sun Microsystems, Inc. All Rights Reserved.