Class HttpField<T>
java.lang.Object
org.jdrupes.httpcodec.protocols.http.HttpField<T>
- Type Parameters:
T
- the type of the header field’s value
A base class for all kinds of header field values.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected static final Pattern
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the string representation of this field’s value.Returns the string representation of this header field as it appears in an HTTP message.Returns the cconverter used by this field.static Converter<?>
lookupConverter
(String fieldName) Returns the proper converter for the header field with the given name.name()
Returns the header field name.Sets the header field’s value.toString()
value()
Returns the header field’s parsed value.
-
Field Details
-
headerLinePatter
-
ACCEPT
- See Also:
-
ACCEPT_CHARSET
- See Also:
-
ACCEPT_ENCODING
- See Also:
-
ACCEPT_LANGUAGE
- See Also:
-
AGE
- See Also:
-
ALLOW
- See Also:
-
AUTHORIZATION
- See Also:
-
CACHE_CONTROL
- See Also:
-
COOKIE
- See Also:
-
CONNECTION
- See Also:
-
CONTENT_LENGTH
- See Also:
-
CONTENT_LOCATION
- See Also:
-
CONTENT_TYPE
- See Also:
-
DATE
- See Also:
-
ETAG
- See Also:
-
EXPECT
- See Also:
-
EXPIRES
- See Also:
-
FROM
- See Also:
-
HOST
- See Also:
-
IF_MATCH
- See Also:
-
IF_NONE_MATCH
- See Also:
-
IF_MODIFIED_SINCE
- See Also:
-
IF_UNMODIFIED_SINCE
- See Also:
-
LAST_MODIFIED
- See Also:
-
LOCATION
- See Also:
-
MAX_FORWARDS
- See Also:
-
PRAGMA
- See Also:
-
PROXY_AUTHENTICATE
- See Also:
-
PROXY_AUTHORIZATION
- See Also:
-
RETRY_AFTER
- See Also:
-
SERVER
- See Also:
-
SET_COOKIE
- See Also:
-
TE
- See Also:
-
TRAILER
- See Also:
-
TRANSFER_ENCODING
- See Also:
-
UPGRADE
- See Also:
-
USER_AGENT
- See Also:
-
VARY
- See Also:
-
VIA
- See Also:
-
WARNING
- See Also:
-
WWW_AUTHENTICATE
- See Also:
-
-
Constructor Details
-
HttpField
Creates a new representation of a header field with the given value and converter.For fields with a constant definition in this class, the name is normalized.
- Parameters:
name
- the field namevalue
- the valueconverter
- the converter
-
HttpField
Creates a new representation of a header field from its textual representation.For fields with a constant definition in this class, the name is normalized.
- Parameters:
headerLine
- the header lineconverter
- the converter- Throws:
ParseException
- if an error occurs while parsing the header line
-
-
Method Details
-
lookupConverter
Returns the proper converter for the header field with the given name.Works for all well known field names, i.e. the field names defined as constants in this class. If the field name is unknown, a string converter is returned.
- Parameters:
fieldName
- the field name- Returns:
- the converter
-
name
Returns the header field name.- Returns:
- the name
-
value
Returns the header field’s parsed value.- Returns:
- the field’s value
-
converter
Returns the cconverter used by this field.- Returns:
- the converter
-
setValue
Sets the header field’s value.- Parameters:
value
- the new value- Returns:
- the field for easy chaining
-
asFieldValue
Returns the string representation of this field’s value.- Returns:
- the field value as string
-
asHeaderField
Returns the string representation of this header field as it appears in an HTTP message.Note that the returned string may span several lines (may contain CR/LF), but is has no trailing CR/LF.
- Returns:
- the field as it occurs in a header
-
toString
-