@Immutable public class BasicLineParserHC4 extends java.lang.Object implements org.apache.http.message.LineParser
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.
| Modifier and Type | Field and Description |
|---|---|
static BasicLineParserHC4 |
DEFAULT
Deprecated.
(4.3) use
INSTANCE |
static BasicLineParserHC4 |
INSTANCE |
protected org.apache.http.ProtocolVersion |
protocol
A version of the protocol to parse.
|
| Constructor and Description |
|---|
BasicLineParserHC4()
Creates a new line parser for HTTP.
|
BasicLineParserHC4(org.apache.http.ProtocolVersion proto)
Creates a new line parser for the given HTTP-like protocol.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.http.ProtocolVersion |
createProtocolVersion(int major,
int minor)
Creates a protocol version.
|
protected org.apache.http.RequestLine |
createRequestLine(java.lang.String method,
java.lang.String uri,
org.apache.http.ProtocolVersion ver)
Instantiates a new request line.
|
protected org.apache.http.StatusLine |
createStatusLine(org.apache.http.ProtocolVersion ver,
int status,
java.lang.String reason)
Instantiates a new status line.
|
boolean |
hasProtocolVersion(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor) |
org.apache.http.Header |
parseHeader(org.apache.http.util.CharArrayBuffer buffer) |
static org.apache.http.Header |
parseHeader(java.lang.String value,
org.apache.http.message.LineParser parser) |
org.apache.http.ProtocolVersion |
parseProtocolVersion(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor) |
static org.apache.http.ProtocolVersion |
parseProtocolVersion(java.lang.String value,
org.apache.http.message.LineParser parser) |
org.apache.http.RequestLine |
parseRequestLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor)
Parses a request line.
|
static org.apache.http.RequestLine |
parseRequestLine(java.lang.String value,
org.apache.http.message.LineParser parser) |
org.apache.http.StatusLine |
parseStatusLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor) |
static org.apache.http.StatusLine |
parseStatusLine(java.lang.String value,
org.apache.http.message.LineParser parser) |
protected void |
skipWhitespace(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor)
Helper to skip whitespace.
|
@Deprecated public static final BasicLineParserHC4 DEFAULT
INSTANCEBasicLineParser 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.public static final BasicLineParserHC4 INSTANCE
protected final org.apache.http.ProtocolVersion protocol
public BasicLineParserHC4(org.apache.http.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 BasicLineParserHC4()
public static org.apache.http.ProtocolVersion parseProtocolVersion(java.lang.String value,
org.apache.http.message.LineParser parser)
throws org.apache.http.ParseException
org.apache.http.ParseExceptionpublic org.apache.http.ProtocolVersion parseProtocolVersion(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor)
throws org.apache.http.ParseException
parseProtocolVersion in interface org.apache.http.message.LineParserorg.apache.http.ParseExceptionprotected org.apache.http.ProtocolVersion createProtocolVersion(int major,
int minor)
parseProtocolVersion(java.lang.String, org.apache.http.message.LineParser).major - the major version number, for example 1 in HTTP/1.0minor - the minor version number, for example 0 in HTTP/1.0public boolean hasProtocolVersion(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor)
hasProtocolVersion in interface org.apache.http.message.LineParserpublic static org.apache.http.RequestLine parseRequestLine(java.lang.String value,
org.apache.http.message.LineParser parser)
throws org.apache.http.ParseException
org.apache.http.ParseExceptionpublic org.apache.http.RequestLine parseRequestLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor)
throws org.apache.http.ParseException
parseRequestLine in interface org.apache.http.message.LineParserbuffer - a buffer holding the line to parseorg.apache.http.ParseException - in case of a parse errorprotected org.apache.http.RequestLine createRequestLine(java.lang.String method,
java.lang.String uri,
org.apache.http.ProtocolVersion ver)
parseRequestLine(java.lang.String, org.apache.http.message.LineParser).method - the request methoduri - the requested URIver - the protocol versionpublic static org.apache.http.StatusLine parseStatusLine(java.lang.String value,
org.apache.http.message.LineParser parser)
throws org.apache.http.ParseException
org.apache.http.ParseExceptionpublic org.apache.http.StatusLine parseStatusLine(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor)
throws org.apache.http.ParseException
parseStatusLine in interface org.apache.http.message.LineParserorg.apache.http.ParseExceptionprotected org.apache.http.StatusLine createStatusLine(org.apache.http.ProtocolVersion ver,
int status,
java.lang.String reason)
parseStatusLine(java.lang.String, org.apache.http.message.LineParser).ver - the protocol versionstatus - the status codereason - the reason phrasepublic static org.apache.http.Header parseHeader(java.lang.String value,
org.apache.http.message.LineParser parser)
throws org.apache.http.ParseException
org.apache.http.ParseExceptionpublic org.apache.http.Header parseHeader(org.apache.http.util.CharArrayBuffer buffer)
throws org.apache.http.ParseException
parseHeader in interface org.apache.http.message.LineParserorg.apache.http.ParseExceptionprotected void skipWhitespace(org.apache.http.util.CharArrayBuffer buffer,
org.apache.http.message.ParserCursor cursor)
Copyright © 1999-2015 The Apache Software Foundation. All rights reserved.