@Contract(threading=IMMUTABLE_CONDITIONAL) public class DefaultHttpResponseFactory extends 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 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)
HttpResponseFactorynewHttpResponse in interface HttpResponseFactoryver - 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)
HttpResponseFactorynewHttpResponse in interface HttpResponseFactorystatusline - 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 Locale determineLocale(HttpContext context)
context - the context from which to determine the locale, or
null to use the default localenullCopyright © 2005–2022 The Apache Software Foundation. All rights reserved.