org.apache.hc.core5.http.impl.nio

## Class DefaultHttpResponseParser<T extends HttpResponse>

- java.lang.Object
- - org.apache.hc.core5.http.impl.nio.AbstractMessageParser<T>
  - - org.apache.hc.core5.http.impl.nio.DefaultHttpResponseParser<T>

- All Implemented Interfaces:
    NHttpMessageParser<T>

      public class DefaultHttpResponseParser<T extends HttpResponse>
      extends AbstractMessageParser<T>

  Default `NHttpMessageParser` implementation for `HttpResponse`s.
  Since:
    4.1

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultHttpResponseParser(HttpResponseFactory<T> responseFactory)`
    `DefaultHttpResponseParser(HttpResponseFactory<T> responseFactory, Http1Config http1Config)`
    `DefaultHttpResponseParser(HttpResponseFactory<T> responseFactory, LineParser parser, Http1Config http1Config)` Creates an instance of DefaultHttpResponseParser.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected T` | `createMessage(CharArrayBuffer buffer)` Creates `HttpMessage` instance based on the content of the input buffer containing the first line of the incoming HTTP message.

    - ### Methods inherited from class org.apache.hc.core5.http.impl.nio.AbstractMessageParser

      `parse, reset`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultHttpResponseParser

          public DefaultHttpResponseParser(HttpResponseFactory<T> responseFactory,
                                           LineParser parser,
                                           Http1Config http1Config)

      Creates an instance of DefaultHttpResponseParser.
      Parameters:
        `responseFactory` - the response factory.
        `parser` - the line parser. If `null` `LazyLineParser.INSTANCE` will be used.
        `http1Config` - Message http1Config. If `null` `Http1Config.DEFAULT` will be used.
      Since:
        4.3

    - #### DefaultHttpResponseParser

          public DefaultHttpResponseParser(HttpResponseFactory<T> responseFactory,
                                           Http1Config http1Config)

      Since:
        4.3

    - #### DefaultHttpResponseParser

          public DefaultHttpResponseParser(HttpResponseFactory<T> responseFactory)

      Since:
        4.3

  - ### Method Detail

    - #### createMessage

          protected T createMessage(CharArrayBuffer buffer)
                             throws HttpException

      Description copied from class: `AbstractMessageParser`
      Creates `HttpMessage` instance based on the content of the input buffer containing the first line of the incoming HTTP message.
      Specified by:
        `createMessage` in class `AbstractMessageParser<T extends HttpResponse>`
      Parameters:
        `buffer` - the line buffer.
      Returns:
        HTTP message.
      Throws:
        `HttpException` - in case of HTTP protocol violation

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.