Package org.apache.http.impl
Class EnglishReasonPhraseCatalog
- java.lang.Object
-
- org.apache.http.impl.EnglishReasonPhraseCatalog
-
- All Implemented Interfaces:
ReasonPhraseCatalog
@Contract(threading=IMMUTABLE) public class EnglishReasonPhraseCatalog extends java.lang.Object implements ReasonPhraseCatalog
English reason phrases for HTTP status codes. All status codes defined in RFC1945 (HTTP/1.0), RFC2616 (HTTP/1.1), and RFC2518 (WebDAV) are supported.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description static EnglishReasonPhraseCatalogINSTANCEThe default instance of this catalog.private static java.lang.String[][]REASON_PHRASESReason phrases lookup table.
-
Constructor Summary
Constructors Modifier Constructor Description protectedEnglishReasonPhraseCatalog()Restricted default constructor, for derived classes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetReason(int status, java.util.Locale loc)Obtains the reason phrase for a status code.private static voidsetReason(int status, java.lang.String reason)Stores the given reason phrase, by status code.
-
-
-
Field Detail
-
INSTANCE
public static final EnglishReasonPhraseCatalog INSTANCE
The default instance of this catalog. This catalog is thread safe, so there typically is no need to create other instances.
-
REASON_PHRASES
private static final java.lang.String[][] REASON_PHRASES
Reason phrases lookup table.
-
-
Constructor Detail
-
EnglishReasonPhraseCatalog
protected EnglishReasonPhraseCatalog()
Restricted default constructor, for derived classes. If you need an instance of this class, useINSTANCE.
-
-
Method Detail
-
getReason
public java.lang.String getReason(int status, java.util.Locale loc)Obtains the reason phrase for a status code.- Specified by:
getReasonin interfaceReasonPhraseCatalog- Parameters:
status- the status code, in the range 100-599loc- ignored- Returns:
- the reason phrase, or
null
-
setReason
private static void setReason(int status, java.lang.String reason)Stores the given reason phrase, by status code. Helper method to initialize the static lookup table.- Parameters:
status- the status code for which to define the phrasereason- the reason phrase for this status code
-
-