Top Description Methods
org.apache.hc.core5.http.message

public Interface HeaderValueFormatter

Known Direct Implementers
org.apache.hc.core5.http.message.BasicHeaderValueFormatter
Imports
org.apache.hc.core5.http.HeaderElement, .NameValuePair, org.apache.hc.core5.util.CharArrayBuffer

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 TypeMethod and Description
public void
formatElements(CharArrayBuffer
buffer to write formatted content to.
buffer
,
HeaderElement[]
the header elements to format
elems
,
boolean
true to always format with quoted values, false to use quotes only when necessary
quote
)

Formats an array of header elements.

public void
formatHeaderElement(CharArrayBuffer
buffer to write formatted content to.
buffer
,
HeaderElement
the header element to format
elem
,
boolean
true to always format with quoted values, false to use quotes only when necessary
quote
)

Formats one header element.

public void
formatNameValuePair(CharArrayBuffer
buffer to write formatted content to.
buffer
,
NameValuePair
the name-value pair to format
nvp
,
boolean
true to always format with a quoted value, false to use quotes only when necessary
quote
)

Formats one name-value pair, where the value is optional.

public void
formatParameters(CharArrayBuffer
buffer to write formatted content to.
buffer
,
NameValuePair[]
the parameters (name-value pairs) to format
nvps
,
boolean
true to always format with quoted values, false to use quotes only when necessary
quote
)

Formats the parameters of a header element.

Method Detail

formatElementsback to summary
public void formatElements(CharArrayBuffer buffer, HeaderElement[] elems, boolean quote)

Formats an array of header elements.

Parameters
buffer:CharArrayBuffer

buffer to write formatted content to.

elems:HeaderElement[]

the header elements to format

quote:boolean

true to always format with quoted values, false to use quotes only when necessary

formatHeaderElementback to summary
public void formatHeaderElement(CharArrayBuffer buffer, HeaderElement elem, boolean quote)

Formats one header element.

Parameters
buffer:CharArrayBuffer

buffer to write formatted content to.

elem:HeaderElement

the header element to format

quote:boolean

true to always format with quoted values, false to use quotes only when necessary

formatNameValuePairback to summary
public void formatNameValuePair(CharArrayBuffer buffer, NameValuePair nvp, boolean quote)

Formats one name-value pair, where the value is optional.

Parameters
buffer:CharArrayBuffer

buffer to write formatted content to.

nvp:NameValuePair

the name-value pair to format

quote:boolean

true to always format with a quoted value, false to use quotes only when necessary

formatParametersback to summary
public void formatParameters(CharArrayBuffer buffer, NameValuePair[] nvps, boolean quote)

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:CharArrayBuffer

buffer to write formatted content to.

nvps:NameValuePair[]

the parameters (name-value pairs) to format

quote:boolean

true to always format with quoted values, false to use quotes only when necessary