| java.lang.Object org.apache.http.message.BasicLineParser
BasicLineParser | public class BasicLineParser implements LineParser(Code) | | Basic parser for 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 class are stateless and thread-safe.
Derived classes MUST maintain these properties.
Note: This class was created by refactoring parsing code located in
various other classes. The author tags from those other classes have
been replicated here, although the association with the parsing code
taken from there has not been traced.
author: Jeff Dever author: Mike Bowler author: Oleg Kalnichevski author: and others |
Constructor Summary | |
public | BasicLineParser(ProtocolVersion proto) Creates a new line parser for the given HTTP-like protocol.
Parameters: proto - a version of the protocol to parse, ornull for HTTP. | public | BasicLineParser() Creates a new line parser for HTTP. |
Method Summary | |
protected ProtocolVersion | createProtocolVersion(int major, int minor) Creates a protocol version. | protected RequestLine | createRequestLine(String method, String uri, ProtocolVersion ver) Instantiates a new request line. | protected StatusLine | createStatusLine(ProtocolVersion ver, int status, String reason) Instantiates a new status line. | public boolean | hasProtocolVersion(CharArrayBuffer buffer, ParserCursor cursor) | final public static Header | parseHeader(String value, LineParser parser) | public Header | parseHeader(CharArrayBuffer buffer) | final public static ProtocolVersion | parseProtocolVersion(String value, LineParser parser) | public ProtocolVersion | parseProtocolVersion(CharArrayBuffer buffer, ParserCursor cursor) | final public static RequestLine | parseRequestLine(String value, LineParser parser) | public RequestLine | parseRequestLine(CharArrayBuffer buffer, ParserCursor cursor) Parses a request line. | final public static StatusLine | parseStatusLine(String value, LineParser parser) | public StatusLine | parseStatusLine(CharArrayBuffer buffer, ParserCursor cursor) | protected void | skipWhitespace(CharArrayBuffer buffer, ParserCursor cursor) Helper to skip whitespace. |
DEFAULT | final public static BasicLineParser DEFAULT(Code) | | A default instance of this class, for use as default or fallback.
Note that
BasicLineParser is not a singleton, there can
be many instances of the class itself and of derived classes.
The instance here provides non-customized, default behavior.
|
protocol | final protected ProtocolVersion protocol(Code) | | A version of the protocol to parse.
The version is typically not relevant, but the protocol name.
|
BasicLineParser | public BasicLineParser(ProtocolVersion proto)(Code) | | Creates a new line parser for the given HTTP-like protocol.
Parameters: proto - a version of the protocol to parse, ornull for HTTP. The actual versionis not relevant, only the protocol name. |
BasicLineParser | public BasicLineParser()(Code) | | Creates a new line parser for HTTP.
|
createProtocolVersion | protected ProtocolVersion createProtocolVersion(int major, int minor)(Code) | | Creates a protocol version.
Called from
BasicLineParser.parseProtocolVersion .
Parameters: major - the major version number, for example 1 in HTTP/1.0 Parameters: minor - the minor version number, for example 0 in HTTP/1.0 the protocol version |
|
|