| Modifier and Type | Field and Description |
|---|---|
| public static final BasicHeaderValueFormatter | DEFAULT
A default instance of this class, for use as default or fallback. |
| public static final BasicHeaderValueFormatter | |
| public static final String | SEPARATORS
Special characters that can be used as separators in HTTP parameters. |
| public static final String | UNSAFE_CHARS
Unsafe special characters that must be escaped using the backslash character |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | doFormatValue(final CharArrayBuffer
the buffer to append to, never buffer, final String nullthe value to append, never value, final boolean nulltrue to always format with quotes,
false to use quotes only when necessaryActually formats the value of a name-value pair. |
| protected int | Returns: a length estimate, in number of charactersthe header elements to format, or elems)nullEstimates the length of formatted header elements. |
| protected int | Returns: a length estimate, in number of charactersthe header element to format, or elem)nullEstimates the length of a formatted header element. |
| protected int | Returns: a length estimate, in number of charactersthe name-value pair to format, or nvp)nullEstimates the length of a formatted name-value pair. |
| protected int | Returns: a length estimate, in number of charactersthe parameters to format, or nvps)nullEstimates the length of formatted parameters. |
| public static String | Returns: the formatted header elementsthe header elements to format elems, final boolean true to always format with quoted values,
false to use quotes only when necessarythe formatter to use, or formatter)null
for the defaultFormats an array of header elements. |
| public CharArrayBuffer | formatElements(final CharArrayBuffer
the buffer to append to, or
charBuffer, final HeaderElement[] null to create a new bufferthe header elements to format elems, final boolean true to always format with quoted values,
false to use quotes only when necessaryImplements org. |
| public static String | Returns: the formatted header elementthe header element to format elem, final boolean true to always format with quoted values,
false to use quotes only when necessarythe formatter to use, or formatter)null
for the defaultFormats a header element. |
| public CharArrayBuffer | formatHeaderElement(final CharArrayBuffer
the buffer to append to, or
charBuffer, final HeaderElement null to create a new bufferthe header element to format elem, final boolean true to always format with quoted values,
false to use quotes only when necessaryImplements org. |
| public static String | Returns: the formatted name-value pairthe name-value pair to format nvp, final boolean true to always format with a quoted value,
false to use quotes only when necessarythe formatter to use, or formatter)null
for the defaultFormats a name-value pair. |
| public CharArrayBuffer | formatNameValuePair(final CharArrayBuffer
the buffer to append to, or
charBuffer, final NameValuePair null to create a new bufferthe name-value pair to format nvp, final boolean true to always format with a quoted value,
false to use quotes only when necessaryImplements org. |
| public static String | Returns: the formatted parametersthe parameters to format nvps, final boolean true to always format with quoted values,
false to use quotes only when necessarythe formatter to use, or formatter)null
for the defaultFormats a set of parameters. |
| public CharArrayBuffer | formatParameters(final CharArrayBuffer
the buffer to append to, or
charBuffer, final NameValuePair[] null to create a new bufferthe parameters (name-value pairs) to format nvps, final boolean true to always format with quoted values,
false to use quotes only when necessaryImplements org. |
| protected boolean | Returns: true if the character is a separator,
false otherwisethe character to check ch)Checks whether a character is a |
| protected boolean |
| DEFAULT | back to summary |
|---|---|
| public static final BasicHeaderValueFormatter DEFAULT
Deprecated (4.3) use A default instance of this class, for use as default or fallback.
Note that | |
| INSTANCE | back to summary |
|---|---|
| public static final BasicHeaderValueFormatter INSTANCE | |
| SEPARATORS | back to summary |
|---|---|
| public static final String SEPARATORS Special characters that can be used as separators in HTTP parameters. These special characters MUST be in a quoted string to be used within a parameter value . | |
| UNSAFE_CHARS | back to summary |
|---|---|
| public static final String UNSAFE_CHARS Unsafe special characters that must be escaped using the backslash character | |
| BasicHeaderValueFormatter | back to summary |
|---|---|
| public BasicHeaderValueFormatter() | |
| doFormatValue | back to summary |
|---|---|
| protected void doFormatValue(final CharArrayBuffer buffer, final String value, final boolean quote) Actually formats the value of a name-value pair.
This does not include a leading = character.
Called from
| |
| estimateElementsLen | back to summary |
|---|---|
| protected int estimateElementsLen(final HeaderElement[] elems) Estimates the length of formatted header elements.
| |
| estimateHeaderElementLen | back to summary |
|---|---|
| protected int estimateHeaderElementLen(final HeaderElement elem) Estimates the length of a formatted header element.
| |
| estimateNameValuePairLen | back to summary |
|---|---|
| protected int estimateNameValuePairLen(final NameValuePair nvp) Estimates the length of a formatted name-value pair.
| |
| estimateParametersLen | back to summary |
|---|---|
| protected int estimateParametersLen(final NameValuePair[] nvps) Estimates the length of formatted parameters.
| |
| formatElements | back to summary |
|---|---|
| public static String formatElements(final HeaderElement[] elems, final boolean quote, final HeaderValueFormatter formatter) Formats an array of header elements.
| |
| formatElements | back to summary |
|---|---|
| public CharArrayBuffer formatElements(final CharArrayBuffer charBuffer, final HeaderElement[] elems, final boolean quote) Implements org. Doc from org. Formats an array of header elements.
| |
| formatHeaderElement | back to summary |
|---|---|
| public static String formatHeaderElement(final HeaderElement elem, final boolean quote, final HeaderValueFormatter formatter) Formats a header element.
| |
| formatHeaderElement | back to summary |
|---|---|
| public CharArrayBuffer formatHeaderElement(final CharArrayBuffer charBuffer, final HeaderElement elem, final boolean quote) Implements org. Doc from org. Formats one header element.
| |
| formatNameValuePair | back to summary |
|---|---|
| public static String formatNameValuePair(final NameValuePair nvp, final boolean quote, final HeaderValueFormatter formatter) Formats a name-value pair.
| |
| formatNameValuePair | back to summary |
|---|---|
| public CharArrayBuffer formatNameValuePair(final CharArrayBuffer charBuffer, final NameValuePair nvp, final boolean quote) Implements org. Doc from org. Formats one name-value pair, where the value is optional.
| |
| formatParameters | back to summary |
|---|---|
| public static String formatParameters(final NameValuePair[] nvps, final boolean quote, final HeaderValueFormatter formatter) Formats a set of parameters.
| |
| formatParameters | back to summary |
|---|---|
| public CharArrayBuffer formatParameters(final CharArrayBuffer charBuffer, final NameValuePair[] nvps, final boolean quote) Implements org. Doc from org. 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.
| |
| isSeparator | back to summary |
|---|---|
| protected boolean isSeparator(final char ch) Checks whether a character is a
| |
| isUnsafe | back to summary |
|---|---|
| protected boolean isUnsafe(final char ch) Checks whether a character is
| |