@Immutable public class DefaultHttpResponseFactory extends java.lang.Object implements HttpResponseFactory
HttpResponse
objects.Modifier and Type | Field and Description |
---|---|
static DefaultHttpResponseFactory |
INSTANCE |
protected ReasonPhraseCatalog |
reasonCatalog
The catalog for looking up reason phrases.
|
Constructor and Description |
---|
DefaultHttpResponseFactory()
Creates a new response factory with the default catalog.
|
DefaultHttpResponseFactory(ReasonPhraseCatalog catalog)
Creates a new response factory with the given catalog.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Locale |
determineLocale(HttpContext context)
Determines the locale of the response.
|
HttpResponse |
newHttpResponse(ProtocolVersion ver,
int status,
HttpContext context)
Creates a new response from status line elements.
|
HttpResponse |
newHttpResponse(StatusLine statusline,
HttpContext context)
Creates a new response from a status line.
|
public static final DefaultHttpResponseFactory INSTANCE
protected final ReasonPhraseCatalog reasonCatalog
public DefaultHttpResponseFactory(ReasonPhraseCatalog catalog)
catalog
- the catalog of reason phrasespublic DefaultHttpResponseFactory()
EnglishReasonPhraseCatalog
.public HttpResponse newHttpResponse(ProtocolVersion ver, int status, HttpContext context)
HttpResponseFactory
newHttpResponse
in interface HttpResponseFactory
ver
- the protocol versionstatus
- the status codecontext
- the context from which to determine the locale
for looking up a reason phrase to the status code, or
null
to use the default localepublic HttpResponse newHttpResponse(StatusLine statusline, HttpContext context)
HttpResponseFactory
newHttpResponse
in interface HttpResponseFactory
statusline
- the status linecontext
- the context from which to determine the locale
for looking up a reason phrase if the status code
is updated, or
null
to use the default localeprotected java.util.Locale determineLocale(HttpContext context)
context
- the context from which to determine the locale, or
null
to use the default localenull