Top Description Fields Constructors Methods
org.apache.http.impl.io

public Class DefaultHttpResponseParser

extends AbstractMessageParser<HttpResponse>
Class Inheritance
Annotations
@SuppressWarnings:deprecation
Imports
java.io.IOException, org.apache.http.HttpException, .HttpResponse, .HttpResponseFactory, .NoHttpResponseException, .ParseException, .StatusLine, org.apache.http.config.MessageConstraints, org.apache.http.impl.DefaultHttpResponseFactory, org.apache.http.io.SessionInputBuffer, org.apache.http.message.LineParser, .ParserCursor, org.apache.http.params.HttpParams, org.apache.http.util.Args, .CharArrayBuffer

HTTP response parser that obtain its input from an instance of SessionInputBuffer.
Since
4.2

Field Summary

Modifier and TypeField and Description
private final CharArrayBuffer
private final HttpResponseFactory
Inherited from org.apache.http.impl.io.AbstractMessageParser:
lineParser

Constructor Summary

AccessConstructor and Description
public
DefaultHttpResponseParser(final SessionInputBuffer
the session input buffer.
buffer
,
final LineParser
the line parser.
lineParser
,
final HttpResponseFactory
the factory to use to create HttpResponses.
responseFactory
,
final HttpParams
HTTP parameters.
params
)

Creates an instance of this class.
public
DefaultHttpResponseParser(final SessionInputBuffer
the session input buffer.
buffer
,
final LineParser
the line parser. If null org.apache.http.message.BasicLineParser#INSTANCE will be used
lineParser
,
final HttpResponseFactory
the response factory. If null DefaultHttpResponseFactory#INSTANCE will be used.
responseFactory
,
final MessageConstraints
the message constraints. If null MessageConstraints#DEFAULT will be used.
constraints
)

Creates new instance of DefaultHttpResponseParser.

public
public

Method Summary

Modifier and TypeMethod and Description
protected HttpResponse
parseHead(final SessionInputBuffer
the session input buffer.
sessionBuffer
)

Implements abstract org.apache.http.impl.io.AbstractMessageParser.parseHead.

Subclasses must override this method to generate an instance of HttpMessage based on the initial input from the session buffer.
Inherited from org.apache.http.impl.io.AbstractMessageParser:
parseparseHeadersparseHeaders

Field Detail

lineBufback to summary
private final CharArrayBuffer lineBuf
responseFactoryback to summary
private final HttpResponseFactory responseFactory

Constructor Detail

DefaultHttpResponseParserback to summary
public DefaultHttpResponseParser(final SessionInputBuffer buffer, final LineParser lineParser, final HttpResponseFactory responseFactory, final HttpParams params)

Creates an instance of this class.

Parameters
buffer:SessionInputBuffer

the session input buffer.

lineParser:LineParser

the line parser.

responseFactory:HttpResponseFactory

the factory to use to create HttpResponses.

params:HttpParams

HTTP parameters.

Annotations
@Deprecated
DefaultHttpResponseParserback to summary
public DefaultHttpResponseParser(final SessionInputBuffer buffer, final LineParser lineParser, final HttpResponseFactory responseFactory, final MessageConstraints constraints)

Creates new instance of DefaultHttpResponseParser.

Parameters
buffer:SessionInputBuffer

the session input buffer.

lineParser:LineParser

the line parser. If null org.apache.http.message.BasicLineParser#INSTANCE will be used

responseFactory:HttpResponseFactory

the response factory. If null DefaultHttpResponseFactory#INSTANCE will be used.

constraints:MessageConstraints

the message constraints. If null MessageConstraints#DEFAULT will be used.

Since
4.3
DefaultHttpResponseParserback to summary
public DefaultHttpResponseParser(final SessionInputBuffer buffer, final MessageConstraints constraints)
Since
4.3
DefaultHttpResponseParserback to summary
public DefaultHttpResponseParser(final SessionInputBuffer buffer)
Since
4.3

Method Detail

parseHeadback to summary
protected HttpResponse parseHead(final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException

Implements abstract org.apache.http.impl.io.AbstractMessageParser.parseHead.

Doc from org.apache.http.impl.io.AbstractMessageParser.parseHead.

Subclasses must override this method to generate an instance of HttpMessage based on the initial input from the session buffer.

Usually this method is expected to read just the very first line or the very first valid from the data stream and based on the input generate an appropriate instance of HttpMessage.

Parameters
sessionBuffer:SessionInputBuffer

the session input buffer.

Returns:HttpResponse

HTTP message based on the input from the session buffer.

Annotations
@Override
Exceptions
IOException:
in case of an I/O error.
HttpException:
in case of HTTP protocol violation.
ParseException:
in case of a parse error.