Package org.apache.hc.core5.http.message
Interface HeaderValueFormatter
- All Known Implementing Classes:
BasicHeaderValueFormatter
public interface HeaderValueFormatter
Interface for formatting elements of a header value.
Instances of this interface are expected to be stateless and thread-safe.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidformatElements(CharArrayBuffer buffer, HeaderElement[] elems, boolean quote) Formats an array of header elements.voidformatHeaderElement(CharArrayBuffer buffer, HeaderElement elem, boolean quote) Formats one header element.voidformatNameValuePair(CharArrayBuffer buffer, NameValuePair nvp, boolean quote) Formats one name-value pair, where the value is optional.voidformatParameters(CharArrayBuffer buffer, NameValuePair[] nvps, boolean quote) Formats the parameters of a header element.
-
Method Details
-
formatElements
Formats an array of header elements.- Parameters:
buffer- buffer to write formatted content to.elems- the header elements to formatquote-trueto always format with quoted values,falseto use quotes only when necessary
-
formatHeaderElement
Formats one header element.- Parameters:
buffer- buffer to write formatted content to.elem- the header element to formatquote-trueto always format with quoted values,falseto use quotes only when necessary
-
formatParameters
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.- Parameters:
buffer- buffer to write formatted content to.nvps- the parameters (name-value pairs) to formatquote-trueto always format with quoted values,falseto use quotes only when necessary
-
formatNameValuePair
Formats one name-value pair, where the value is optional.- Parameters:
buffer- buffer to write formatted content to.nvp- the name-value pair to formatquote-trueto always format with a quoted value,falseto use quotes only when necessary
-