NHttpMessageParser<T>DefaultHttpRequestParser, DefaultHttpResponseParser, HttpRequestParser, HttpResponseParserpublic abstract class AbstractMessageParser<T extends org.apache.http.HttpMessage> extends java.lang.Object implements NHttpMessageParser<T>
NHttpMessageParser that serves as a base for all message
parser implementations.| Modifier and Type | Field | Description |
|---|---|---|
protected org.apache.http.message.LineParser |
lineParser |
| Constructor | Description |
|---|---|
AbstractMessageParser(SessionInputBuffer buffer,
org.apache.http.message.LineParser lineParser,
org.apache.http.config.MessageConstraints constraints) |
Creates an instance of AbstractMessageParser.
|
AbstractMessageParser(SessionInputBuffer buffer,
org.apache.http.message.LineParser lineParser,
org.apache.http.params.HttpParams params) |
Deprecated.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract T |
createMessage(org.apache.http.util.CharArrayBuffer buffer) |
Creates
HttpMessage instance based on the content of the input
buffer containing the first line of the incoming HTTP message. |
int |
fillBuffer(java.nio.channels.ReadableByteChannel channel) |
Fills the internal buffer of the parser with input data from the
given
ReadableByteChannel. |
T |
parse() |
Attempts to parse a complete message head from the content of the
internal buffer.
|
void |
reset() |
Resets the parser.
|
@Deprecated public AbstractMessageParser(SessionInputBuffer buffer, org.apache.http.message.LineParser lineParser, org.apache.http.params.HttpParams params)
AbstractMessageParser(SessionInputBuffer, LineParser,
MessageConstraints)buffer - the session input buffer.lineParser - the line parser.params - HTTP parameters.public AbstractMessageParser(SessionInputBuffer buffer, org.apache.http.message.LineParser lineParser, org.apache.http.config.MessageConstraints constraints)
buffer - the session input buffer.lineParser - the line parser. If null BasicLineParser.INSTANCE
will be used.constraints - Message constraints. If null
MessageConstraints.DEFAULT will be used.public void reset()
NHttpMessageParserreset in interface NHttpMessageParser<T extends org.apache.http.HttpMessage>public int fillBuffer(java.nio.channels.ReadableByteChannel channel)
throws java.io.IOException
NHttpMessageParserReadableByteChannel.fillBuffer in interface NHttpMessageParser<T extends org.apache.http.HttpMessage>channel - the input channeljava.io.IOException - in case of an I/O error.protected abstract T createMessage(org.apache.http.util.CharArrayBuffer buffer) throws org.apache.http.HttpException, org.apache.http.ParseException
HttpMessage instance based on the content of the input
buffer containing the first line of the incoming HTTP message.buffer - the line buffer.org.apache.http.HttpException - in case of HTTP protocol violationorg.apache.http.ParseException - in case of a parse error.public T parse() throws java.io.IOException, org.apache.http.HttpException
NHttpMessageParsernull.parse in interface NHttpMessageParser<T extends org.apache.http.HttpMessage>null otherwise.java.io.IOException - in case of an I/O error.org.apache.http.HttpException - in case the HTTP message is malformed or
violates the HTTP protocol.