org.apache.http.impl
Class DefaultHttpResponseFactoryHC4

java.lang.Object
  extended by org.apache.http.impl.DefaultHttpResponseFactoryHC4
All Implemented Interfaces:
org.apache.http.HttpResponseFactory

@Immutable
public class DefaultHttpResponseFactoryHC4
extends java.lang.Object
implements org.apache.http.HttpResponseFactory

Default factory for creating HttpResponse objects.

Since:
4.0

Field Summary
static DefaultHttpResponseFactoryHC4 INSTANCE
           
protected  org.apache.http.ReasonPhraseCatalog reasonCatalog
          The catalog for looking up reason phrases.
 
Constructor Summary
DefaultHttpResponseFactoryHC4()
          Creates a new response factory with the default catalog.
DefaultHttpResponseFactoryHC4(org.apache.http.ReasonPhraseCatalog catalog)
          Creates a new response factory with the given catalog.
 
Method Summary
protected  java.util.Locale determineLocale(org.apache.http.protocol.HttpContext context)
          Determines the locale of the response.
 org.apache.http.HttpResponse newHttpResponse(org.apache.http.ProtocolVersion ver, int status, org.apache.http.protocol.HttpContext context)
           
 org.apache.http.HttpResponse newHttpResponse(org.apache.http.StatusLine statusline, org.apache.http.protocol.HttpContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DefaultHttpResponseFactoryHC4 INSTANCE

reasonCatalog

protected final org.apache.http.ReasonPhraseCatalog reasonCatalog
The catalog for looking up reason phrases.

Constructor Detail

DefaultHttpResponseFactoryHC4

public DefaultHttpResponseFactoryHC4(org.apache.http.ReasonPhraseCatalog catalog)
Creates a new response factory with the given catalog.

Parameters:
catalog - the catalog of reason phrases

DefaultHttpResponseFactoryHC4

public DefaultHttpResponseFactoryHC4()
Creates a new response factory with the default catalog. The default catalog is EnglishReasonPhraseCatalog.

Method Detail

newHttpResponse

public org.apache.http.HttpResponse newHttpResponse(org.apache.http.ProtocolVersion ver,
                                                    int status,
                                                    org.apache.http.protocol.HttpContext context)
Specified by:
newHttpResponse in interface org.apache.http.HttpResponseFactory

newHttpResponse

public org.apache.http.HttpResponse newHttpResponse(org.apache.http.StatusLine statusline,
                                                    org.apache.http.protocol.HttpContext context)
Specified by:
newHttpResponse in interface org.apache.http.HttpResponseFactory

determineLocale

protected java.util.Locale determineLocale(org.apache.http.protocol.HttpContext context)
Determines the locale of the response. The implementation in this class always returns the default locale.

Parameters:
context - the context from which to determine the locale, or null to use the default locale
Returns:
the locale for the response, never null