org.apache.hc.core5.http.message

## Class LazyLineParser

- java.lang.Object
- - org.apache.hc.core5.http.message.BasicLineParser
  - - org.apache.hc.core5.http.message.LazyLineParser

- All Implemented Interfaces:
    LineParser

      @Contract(threading=IMMUTABLE)
      public class LazyLineParser
      extends BasicLineParser

  Extension of `BasicLineParser` that defers parsing of header values. Header value is parsed only if accessed with `NameValuePair.getValue()`.

  This parser should be used to parse request messages on the server server.

  Since:
    5.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static LazyLineParser` | `INSTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LazyLineParser()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Header` | `parseHeader(CharArrayBuffer buffer)` Parses a header from the given buffer containing one line of text.

    - ### Methods inherited from class org.apache.hc.core5.http.message.BasicLineParser

      `parseRequestLine, parseStatusLine`

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

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

- - ### Field Detail

    - #### INSTANCE

          public static final LazyLineParser INSTANCE

  - ### Constructor Detail

    - #### LazyLineParser

          public LazyLineParser()

  - ### Method Detail

    - #### parseHeader

          public Header parseHeader(CharArrayBuffer buffer)
                             throws ParseException

      Description copied from interface: `LineParser`
      Parses a header from the given buffer containing one line of text. The full header line is expected here. Header continuation lines must be joined by the caller before invoking this method.
      Specified by:
        `parseHeader` in interface `LineParser`
      Overrides:
        `parseHeader` in class `BasicLineParser`
      Parameters:
        `buffer` - a buffer holding the full header line.
      Returns:
        the header in the argument buffer.
      Throws:
        `ParseException` - in case of a parse error

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