|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LineParser
Interface for parsing lines in the HEAD section of an HTTP message. There are individual methods for parsing a request line, a status line, or a header line. The lines to parse are passed in memory, the parser does not depend on any specific IO mechanism. Instances of this interface are expected to be stateless and thread-safe.
Method Summary | |
---|---|
boolean |
hasProtocolVersion(CharArrayBuffer buffer,
int index)
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,
int indexFrom,
int indexTo)
Parses the textual representation of a protocol version. |
RequestLine |
parseRequestLine(CharArrayBuffer buffer,
int indexFrom,
int indexTo)
Parses a request line. |
StatusLine |
parseStatusLine(CharArrayBuffer buffer,
int indexFrom,
int indexTo)
Parses a status line. |
Method Detail |
---|
ProtocolVersion parseProtocolVersion(CharArrayBuffer buffer, int indexFrom, int indexTo) throws ParseException
buffer
- a buffer holding the protocol version to parse
ParseException
- in case of a parse errorboolean hasProtocolVersion(CharArrayBuffer buffer, int index)
parseProtocolVersion(org.apache.http.util.CharArrayBuffer, int, int)
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 inspectindex
- the index 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, int indexFrom, int indexTo) throws ParseException
buffer
- a buffer holding the line to parse
ParseException
- in case of a parse errorStatusLine parseStatusLine(CharArrayBuffer buffer, int indexFrom, int indexTo) throws ParseException
buffer
- a buffer holding the line to parse
ParseException
- 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 error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |