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

public Class BasicLineParser

extends Object
implements LineParser
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.message.LineParser
Known Direct Subclasses
org.apache.hc.core5.http.message.LazyLaxLineParser, org.apache.hc.core5.http.message.LazyLineParser
Annotations
@Contract
threading:IMMUTABLE
Imports
java.util.BitSet, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.Header, .HttpVersion, .ParseException, .ProtocolVersion, org.apache.hc.core5.util.Args, .CharArrayBuffer, .TextUtils, .Tokenizer

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

Field Summary

Modifier and TypeField and Description
private static final BitSet
private static final BitSet
private static final BitSet
public static final BasicLineParser
private final ProtocolVersion
protocol

A version of the protocol to parse.

private final Tokenizer

Constructor Summary

AccessConstructor and Description
public
BasicLineParser(final ProtocolVersion
a version of the protocol to parse, or null for HTTP. The actual version is not relevant, only the protocol name.
proto
)

Creates a new line parser for the given HTTP-like protocol.

public
BasicLineParser()

Creates a new line parser for HTTP.

Method Summary

Modifier and TypeMethod and Description
public Header
parseHeader(final CharArrayBuffer
a buffer holding the full header line.
buffer
)

Implements org.apache.hc.core5.http.message.LineParser.parseHeader.

Parses a header from the given buffer containing one line of text.
pack-priv ProtocolVersion
public RequestLine

Returns:

the parsed request line
parseRequestLine
(final CharArrayBuffer
a buffer holding the line to parse
buffer
)

Implements org.apache.hc.core5.http.message.LineParser.parseRequestLine.

Parses a request line.
public StatusLine
parseStatusLine(final CharArrayBuffer
a buffer holding a line to parse
buffer
)

Implements org.apache.hc.core5.http.message.LineParser.parseStatusLine.

Parses a status line from the given buffer containing one line of text.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BLANKSback to summary
private static final BitSet BLANKS
COLONback to summary
private static final BitSet COLON
FULL_STOPback to summary
private static final BitSet FULL_STOP
INSTANCEback to summary
public static final BasicLineParser INSTANCE
protocolback to summary
private final ProtocolVersion protocol

A version of the protocol to parse. The version is typically not relevant, but the protocol name.

tokenizerback to summary
private final Tokenizer tokenizer

Constructor Detail

BasicLineParserback to summary
public BasicLineParser(final ProtocolVersion proto)

Creates a new line parser for the given HTTP-like protocol.

Parameters
proto:ProtocolVersion

a version of the protocol to parse, or null for HTTP. The actual version is not relevant, only the protocol name.

BasicLineParserback to summary
public BasicLineParser()

Creates a new line parser for HTTP.

Method Detail

parseHeaderback to summary
public Header parseHeader(final CharArrayBuffer buffer) throws ParseException

Implements org.apache.hc.core5.http.message.LineParser.parseHeader.

Doc from org.apache.hc.core5.http.message.LineParser.parseHeader.

Parses a header from the given buffer containing one line of text. The full header line is expected here. Header continuation lines must be joined by the caller before invoking this method.

Parameters
buffer:CharArrayBuffer

a buffer holding the full header line.

Returns:Header

the header in the argument buffer.

Annotations
@Override
Exceptions
ParseException:
in case of a parse error
parseProtocolVersionback to summary
pack-priv ProtocolVersion parseProtocolVersion(final CharArrayBuffer buffer, final ParserCursor cursor) throws ParseException
parseRequestLineback to summary
public RequestLine parseRequestLine(final CharArrayBuffer buffer) throws ParseException

Implements org.apache.hc.core5.http.message.LineParser.parseRequestLine.

Parses a request line.

Parameters
buffer:CharArrayBuffer

a buffer holding the line to parse

Returns:RequestLine

the parsed request line

Annotations
@Override
Exceptions
ParseException:
in case of a parse error
parseStatusLineback to summary
public StatusLine parseStatusLine(final CharArrayBuffer buffer) throws ParseException

Implements org.apache.hc.core5.http.message.LineParser.parseStatusLine.

Doc from org.apache.hc.core5.http.message.LineParser.parseStatusLine.

Parses a status line from the given buffer containing one line of text.

Parameters
buffer:CharArrayBuffer

a buffer holding a line to parse

Returns:StatusLine

the parsed status line

Annotations
@Override
Exceptions
ParseException:
in case of a parse error