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

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

Returns:
the status type.

getEntityType

public Type getEntityType()
Get the entity type.

Returns:
the entity type.

getStatus

public int getStatus()
Specified by:
getStatus in class javax.ws.rs.core.Response

getMetadata

public javax.ws.rs.core.MultivaluedMap<String,Object> getMetadata()
Specified by:
getMetadata in class javax.ws.rs.core.Response

getEntity

public Object getEntity()
Specified by:
getEntity in class javax.ws.rs.core.Response

toStatusType

public static javax.ws.rs.core.Response.StatusType toStatusType(int statusCode)

toFamilyCode

public static javax.ws.rs.core.Response.Status.Family toFamilyCode(int statusCode)


Copyright © 2011 Oracle Corporation. All Rights Reserved.