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

public Class BasicHeaderValueParser

extends Object
implements HeaderValueParser
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.message.HeaderValueParser
Annotations
@Contract
threading:IMMUTABLE
Imports
java.util.ArrayList, .BitSet, .List, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.HeaderElement, .NameValuePair, org.apache.hc.core5.util.Args, .Tokenizer

Default org.apache.hc.core5.http.message.HeaderValueParser implementation.
Since
4.0

Field Summary

Modifier and TypeField and Description
private static final char
private static final HeaderElement[]
EMPTY_HEADER_ELEMENT_ARRAY

An empty immutable HeaderElement array.

private static final NameValuePair[]
EMPTY_NAME_VALUE_ARRAY

An empty immutable NameValuePair array.

public static final BasicHeaderValueParser
private static final char
private static final BitSet
private final Tokenizer
private static final BitSet

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public HeaderElement[]
parseElements(final CharSequence
buffer holding the header value to parse
buffer
,
final ParserCursor
the parser cursor containing the current position and the bounds within the buffer for the parsing operation
cursor
)

Implements org.apache.hc.core5.http.message.HeaderValueParser.parseElements.

Parses a header value into elements.
public HeaderElement
parseHeaderElement(final CharSequence
buffer holding the element to parse
buffer
,
final ParserCursor
the parser cursor containing the current position and the bounds within the buffer for the parsing operation
cursor
)

Implements org.apache.hc.core5.http.message.HeaderValueParser.parseHeaderElement.

Parses a single header element.
public NameValuePair
parseNameValuePair(final CharSequence
the buffer holding the name-value pair to parse
buffer
,
final ParserCursor
the parser cursor containing the current position and the bounds within the buffer for the parsing operation
cursor
)

Implements org.apache.hc.core5.http.message.HeaderValueParser.parseNameValuePair.

Parses a name=value specification, where the = and value are optional.
public NameValuePair[]
parseParameters(final CharSequence
buffer holding the name-value list to parse
buffer
,
final ParserCursor
the parser cursor containing the current position and the bounds within the buffer for the parsing operation
cursor
)

Implements org.apache.hc.core5.http.message.HeaderValueParser.parseParameters.

Parses a list of name-value pairs.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ELEM_DELIMITERback to summary
private static final char ELEM_DELIMITER
EMPTY_HEADER_ELEMENT_ARRAYback to summary
private static final HeaderElement[] EMPTY_HEADER_ELEMENT_ARRAY

An empty immutable HeaderElement array.

EMPTY_NAME_VALUE_ARRAYback to summary
private static final NameValuePair[] EMPTY_NAME_VALUE_ARRAY

An empty immutable NameValuePair array.

INSTANCEback to summary
public static final BasicHeaderValueParser INSTANCE
PARAM_DELIMITERback to summary
private static final char PARAM_DELIMITER
TOKEN_DELIMITERback to summary
private static final BitSet TOKEN_DELIMITER
tokenizerback to summary
private final Tokenizer tokenizer
VALUE_DELIMITERback to summary
private static final BitSet VALUE_DELIMITER

Constructor Detail

BasicHeaderValueParserback to summary
public BasicHeaderValueParser()

Method Detail

parseElementsback to summary
public HeaderElement[] parseElements(final CharSequence buffer, final ParserCursor cursor)

Implements org.apache.hc.core5.http.message.HeaderValueParser.parseElements.

Doc from org.apache.hc.core5.http.message.HeaderValueParser.parseElements.

Parses a header value into elements. Parse errors are indicated as RuntimeException.

Parameters
buffer:CharSequence

buffer holding the header value to parse

cursor:ParserCursor

the parser cursor containing the current position and the bounds within the buffer for the parsing operation

Returns:HeaderElement[]

an array holding all elements of the header value

Annotations
@Override
parseHeaderElementback to summary
public HeaderElement parseHeaderElement(final CharSequence buffer, final ParserCursor cursor)

Implements org.apache.hc.core5.http.message.HeaderValueParser.parseHeaderElement.

Doc from org.apache.hc.core5.http.message.HeaderValueParser.parseHeaderElement.

Parses a single header element. A header element consist of a semicolon-separate list of name=value definitions.

Parameters
buffer:CharSequence

buffer holding the element to parse

cursor:ParserCursor

the parser cursor containing the current position and the bounds within the buffer for the parsing operation

Returns:HeaderElement

the parsed element

Annotations
@Override
parseNameValuePairback to summary
public NameValuePair parseNameValuePair(final CharSequence buffer, final ParserCursor cursor)

Implements org.apache.hc.core5.http.message.HeaderValueParser.parseNameValuePair.

Doc from org.apache.hc.core5.http.message.HeaderValueParser.parseNameValuePair.

Parses a name=value specification, where the = and value are optional.

Parameters
buffer:CharSequence

the buffer holding the name-value pair to parse

cursor:ParserCursor

the parser cursor containing the current position and the bounds within the buffer for the parsing operation

Returns:NameValuePair

the name-value pair, where the value is null if no value is specified

Annotations
@Override
parseParametersback to summary
public NameValuePair[] parseParameters(final CharSequence buffer, final ParserCursor cursor)

Implements org.apache.hc.core5.http.message.HeaderValueParser.parseParameters.

Doc from org.apache.hc.core5.http.message.HeaderValueParser.parseParameters.

Parses a list of name-value pairs. These lists are used to specify parameters to a header element. Parse errors are indicated as ParseException.

Parameters
buffer:CharSequence

buffer holding the name-value list to parse

cursor:ParserCursor

the parser cursor containing the current position and the bounds within the buffer for the parsing operation

Returns:NameValuePair[]

an array holding all items of the name-value list

Annotations
@Override