Package org.apache.hc.core5.http.message
Class BasicHeaderValueFormatter
java.lang.Object
org.apache.hc.core5.http.message.BasicHeaderValueFormatter
- All Implemented Interfaces:
HeaderValueFormatter
@Contract(threading=IMMUTABLE)
public class BasicHeaderValueFormatter
extends Object
implements HeaderValueFormatter
Default
HeaderValueFormatter
implementation.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BasicHeaderValueFormatter
private static final String
private static final String
-
Constructor Summary
Constructors -
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.(package private) void
formatValue
(CharArrayBuffer buffer, String value, boolean quote) (package private) boolean
isSeparator
(char ch) (package private) boolean
isUnsafe
(char ch)
-
Field Details
-
INSTANCE
-
SEPARATORS
- See Also:
-
UNSAFE_CHARS
- See Also:
-
-
Constructor Details
-
BasicHeaderValueFormatter
public BasicHeaderValueFormatter()
-
-
Method Details
-
formatElements
Description copied from interface:HeaderValueFormatter
Formats an array of header elements.- Specified by:
formatElements
in interfaceHeaderValueFormatter
- 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
Description copied from interface:HeaderValueFormatter
Formats one header element.- Specified by:
formatHeaderElement
in interfaceHeaderValueFormatter
- 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
Description copied from interface:HeaderValueFormatter
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.- Specified by:
formatParameters
in interfaceHeaderValueFormatter
- 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
Description copied from interface:HeaderValueFormatter
Formats one name-value pair, where the value is optional.- Specified by:
formatNameValuePair
in interfaceHeaderValueFormatter
- 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
-
formatValue
-
isSeparator
boolean isSeparator(char ch) -
isUnsafe
boolean isUnsafe(char ch)
-