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>

- Type Parameters:
    `T` - The type of `HttpResponse`.
  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(Http1Config http1Config, HttpResponseFactory<T> responseFactory)`
    `DefaultHttpResponseParser(Http1Config http1Config, LineParser parser, HttpResponseFactory<T> responseFactory)`
    `DefaultHttpResponseParser(HttpResponseFactory<T> responseFactory)`
    `DefaultHttpResponseParser(HttpResponseFactory<T> responseFactory, Http1Config http1Config)` Deprecated. Use `DefaultHttpResponseParser(Http1Config, HttpResponseFactory)`
    `DefaultHttpResponseParser(HttpResponseFactory<T> responseFactory, LineParser parser, Http1Config http1Config)` Deprecated. Use `DefaultHttpResponseParser(Http1Config, LineParser, HttpResponseFactory)`

  - ### 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(Http1Config http1Config,
                                           LineParser parser,
                                           HttpResponseFactory<T> responseFactory)

      Since:
        5.3

    - #### DefaultHttpResponseParser

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

      Since:
        5.3

    - #### DefaultHttpResponseParser

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

      Deprecated. Use `DefaultHttpResponseParser(Http1Config, LineParser, HttpResponseFactory)`

    - #### DefaultHttpResponseParser

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

      Deprecated. Use `DefaultHttpResponseParser(Http1Config, HttpResponseFactory)`

    - #### 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–2021 The Apache Software Foundation. All rights reserved.