public interface LineParser
Modifier and Type | Method and Description |
---|---|
boolean |
hasProtocolVersion(CharArrayBuffer buffer,
ParserCursor cursor)
Checks whether there likely is a protocol version in a line.
|
Header |
parseHeader(CharArrayBuffer buffer)
Creates a header from a line.
|
ProtocolVersion |
parseProtocolVersion(CharArrayBuffer buffer,
ParserCursor cursor)
Parses the textual representation of a protocol version.
|
RequestLine |
parseRequestLine(CharArrayBuffer buffer,
ParserCursor cursor)
Parses a request line.
|
StatusLine |
parseStatusLine(CharArrayBuffer buffer,
ParserCursor cursor)
Parses a status line.
|
ProtocolVersion parseProtocolVersion(CharArrayBuffer buffer, ParserCursor cursor) throws ParseException
buffer
- a buffer holding the protocol version to parsecursor
- the parser cursor containing the current position and
the bounds within the buffer for the parsing operationParseException
- in case of a parse errorboolean hasProtocolVersion(CharArrayBuffer buffer, ParserCursor cursor)
parseProtocolVersion(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)
would not
detect a parse error.
This can be used to detect garbage lines before a request
or status line.buffer
- a buffer holding the line to inspectcursor
- the cursor at which to check for a protocol version, or
negative for "end of line". Whether the check tolerates
whitespace before or after the protocol version is
implementation dependent.true
if there is a protocol version at the
argument index (possibly ignoring whitespace),
false
otherwiseRequestLine parseRequestLine(CharArrayBuffer buffer, ParserCursor cursor) throws ParseException
buffer
- a buffer holding the line to parsecursor
- the parser cursor containing the current position and
the bounds within the buffer for the parsing operationParseException
- in case of a parse errorStatusLine parseStatusLine(CharArrayBuffer buffer, ParserCursor cursor) throws ParseException
buffer
- a buffer holding the line to parsecursor
- the parser cursor containing the current position and
the bounds within the buffer for the parsing operationParseException
- in case of a parse errorHeader parseHeader(CharArrayBuffer buffer) throws ParseException
buffer
- a buffer holding the full header line.
This buffer MUST NOT be re-used afterwards, since
the returned object may reference the contents later.ParseException
- in case of a parse errorCopyright © 2005–2022 The Apache Software Foundation. All rights reserved.