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 TypeMethodDescriptionvoid
formatElements
(CharArrayBuffer buffer, HeaderElement[] elems, boolean quote) Formats an array of header elements.void
formatHeaderElement
(CharArrayBuffer buffer, HeaderElement elem, boolean quote) Formats one header element.void
formatNameValuePair
(CharArrayBuffer buffer, NameValuePair nvp, boolean quote) Formats one name-value pair, where the value is optional.void
formatParameters
(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
-true
to always format with quoted values,false
to use quotes only when necessary
-
formatHeaderElement
Formats one header element.- Parameters:
buffer
- buffer to write formatted content to.elem
- the header element to formatquote
-true
to always format with quoted values,false
to 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
-true
to always format with quoted values,false
to 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
-true
to always format with a quoted value,false
to use quotes only when necessary
-