@Contract(threading=IMMUTABLE) public class BasicLineParser extends Object implements LineParser
LineParser implementation.| Modifier and Type | Field and Description |
|---|---|
static BasicLineParser |
INSTANCE |
| Constructor and Description |
|---|
BasicLineParser()
Creates a new line parser for HTTP.
|
BasicLineParser(ProtocolVersion proto)
Creates a new line parser for the given HTTP-like protocol.
|
| Modifier and Type | Method and Description |
|---|---|
Header |
parseHeader(CharArrayBuffer buffer)
Parses a header from the given buffer containing one line of text.
|
RequestLine |
parseRequestLine(CharArrayBuffer buffer)
Parses a request line.
|
StatusLine |
parseStatusLine(CharArrayBuffer buffer)
Parses a status line from the given buffer containing one line of text.
|
public static final BasicLineParser INSTANCE
public BasicLineParser(ProtocolVersion proto)
proto - a version of the protocol to parse, or
null for HTTP. The actual version
is not relevant, only the protocol name.public BasicLineParser()
public RequestLine parseRequestLine(CharArrayBuffer buffer) throws ParseException
parseRequestLine in interface LineParserbuffer - a buffer holding the line to parseParseException - in case of a parse errorpublic StatusLine parseStatusLine(CharArrayBuffer buffer) throws ParseException
LineParserparseStatusLine in interface LineParserbuffer - a buffer holding a line to parseParseException - in case of a parse errorpublic Header parseHeader(CharArrayBuffer buffer) throws ParseException
LineParserparseHeader in interface LineParserbuffer - a buffer holding the full header line.ParseException - in case of a parse errorCopyright © 2005–2022 The Apache Software Foundation. All rights reserved.