HeaderValueParser.
Instances of this interface are expected to be stateless and thread-safe.
All formatting methods accept an optional buffer argument. If a buffer is passed in, the formatted element will be appended and the modified buffer is returned. If no buffer is passed in, a new buffer will be created and filled with the formatted element. In both cases, the caller is allowed to modify the returned buffer.
| Modifier and Type | Method and Description |
|---|---|
| public CharArrayBuffer | Returns: a buffer with the formatted header elements. If thebuffer argument was not null,
that buffer will be used and returned.the buffer to append to, or
buffer, HeaderElement[] null to create a new bufferthe header elements to format elems, boolean true to always format with quoted values,
false to use quotes only when necessaryFormats an array of header elements. |
| public CharArrayBuffer | Returns: a buffer with the formatted header element. If thebuffer argument was not null,
that buffer will be used and returned.the buffer to append to, or
buffer, HeaderElement null to create a new bufferthe header element to format elem, boolean true to always format with quoted values,
false to use quotes only when necessaryFormats one header element. |
| public CharArrayBuffer | Returns: a buffer with the formatted name-value pair. If thebuffer argument was not null,
that buffer will be used and returned.the buffer to append to, or
buffer, NameValuePair null to create a new bufferthe name-value pair to format nvp, boolean true to always format with a quoted value,
false to use quotes only when necessaryFormats one name-value pair, where the value is optional. |
| public CharArrayBuffer | Returns: a buffer with the formatted parameters. If thebuffer argument was not null,
that buffer will be used and returned.the buffer to append to, or
buffer, NameValuePair[] null to create a new bufferthe parameters (name-value pairs) to format nvps, boolean true to always format with quoted values,
false to use quotes only when necessaryFormats the parameters of a header element. |
| formatElements | back to summary |
|---|---|
| public CharArrayBuffer formatElements(CharArrayBuffer buffer, HeaderElement[] elems, boolean quote) Formats an array of header elements.
| |
| formatHeaderElement | back to summary |
|---|---|
| public CharArrayBuffer formatHeaderElement(CharArrayBuffer buffer, HeaderElement elem, boolean quote) Formats one header element.
| |
| formatNameValuePair | back to summary |
|---|---|
| public CharArrayBuffer formatNameValuePair(CharArrayBuffer buffer, NameValuePair nvp, boolean quote) Formats one name-value pair, where the value is optional.
| |
| formatParameters | back to summary |
|---|---|
| public CharArrayBuffer formatParameters(CharArrayBuffer buffer, NameValuePair[] nvps, boolean quote) Formats the parameters of a header element. That's a list of name-value pairs, to be separated by semicolons. This method will not generate a leading semicolon.
| |