io.undertow.server.protocol.http

## Class HttpRequestParser

- java.lang.Object
- - io.undertow.server.protocol.http.HttpRequestParser

    public abstract class HttpRequestParser
    extends Object

The basic HTTP parser. The actual parser is a sub class of this class that is generated as part of the build process by the `AbstractParserGenerator` annotation processor.

The actual processor is a state machine, that means that for common header, method, protocol values it will return an interned string, rather than creating a new string for each one.

Author:
  Stuart Douglas

### Field Summary

Fields
`static int` `HTTP_LENGTH`

### Constructor Summary

Constructors
Constructor and Description
`HttpRequestParser(org.xnio.OptionMap options)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `handle(ByteBuffer buffer, io.undertow.server.protocol.http.ParseState currentState, HttpServerExchange builder)`
`protected void` `handleAfterVersion(ByteBuffer buffer, io.undertow.server.protocol.http.ParseState state)`
`protected boolean` `handleCachedHeader(String existing, ByteBuffer buffer, io.undertow.server.protocol.http.ParseState state, HttpServerExchange builder)`
`protected static Map<String,HttpString>` `httpStrings()` This is a bit of hack to enable the parser to get access to the HttpString's that are sorted in the static fields of the relevant classes.
`static HttpRequestParser` `instance(org.xnio.OptionMap options)`
`static boolean` `isTargetCharacterAllowed(char c)`

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

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

### Field Detail

#### HTTP_LENGTH

    public static final int HTTP_LENGTH

### Constructor Detail

#### HttpRequestParser

    public HttpRequestParser(org.xnio.OptionMap options)

### Method Detail

#### isTargetCharacterAllowed

    public static boolean isTargetCharacterAllowed(char c)

#### instance

    public static final HttpRequestParser instance(org.xnio.OptionMap options)

#### handle

    public void handle(ByteBuffer buffer,
                       io.undertow.server.protocol.http.ParseState currentState,
                       HttpServerExchange builder)
                throws BadRequestException

Throws:
  `BadRequestException`

#### handleCachedHeader

    protected boolean handleCachedHeader(String existing,
                                         ByteBuffer buffer,
                                         io.undertow.server.protocol.http.ParseState state,
                                         HttpServerExchange builder)
                                  throws BadRequestException

Throws:
  `BadRequestException`

#### handleAfterVersion

    protected void handleAfterVersion(ByteBuffer buffer,
                                      io.undertow.server.protocol.http.ParseState state)
                               throws BadRequestException

Throws:
  `BadRequestException`

#### httpStrings

    protected static Map<String,HttpString> httpStrings()

This is a bit of hack to enable the parser to get access to the HttpString's that are sorted in the static fields of the relevant classes. This means that in most cases a HttpString comparison will take the fast path == route, as they will be the same object

Returns: