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 BasicHeaderValueFormatterprivate static final Stringprivate static final String -
Constructor Summary
Constructors -
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.(package private) voidformatValue(CharArrayBuffer buffer, String value, boolean quote) (package private) booleanisSeparator(char ch) (package private) booleanisUnsafe(char ch)
-
Field Details
-
INSTANCE
-
SEPARATORS
- See Also:
-
UNSAFE_CHARS
- See Also:
-
-
Constructor Details
-
BasicHeaderValueFormatter
public BasicHeaderValueFormatter()
-
-
Method Details
-
formatElements
Description copied from interface:HeaderValueFormatterFormats an array of header elements.- Specified by:
formatElementsin interfaceHeaderValueFormatter- 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
Description copied from interface:HeaderValueFormatterFormats one header element.- Specified by:
formatHeaderElementin interfaceHeaderValueFormatter- 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
Description copied from interface:HeaderValueFormatterFormats 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:
formatParametersin interfaceHeaderValueFormatter- 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
Description copied from interface:HeaderValueFormatterFormats one name-value pair, where the value is optional.- Specified by:
formatNameValuePairin interfaceHeaderValueFormatter- 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
-
formatValue
-
isSeparator
boolean isSeparator(char ch) -
isUnsafe
boolean isUnsafe(char ch)
-