Class HttpRequestParser


  • public abstract class HttpRequestParser
    extends java.lang.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 
      Modifier and Type Field Description
      static int HTTP_LENGTH  
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpRequestParser​(org.xnio.OptionMap options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handle​(java.nio.ByteBuffer buffer, io.undertow.server.protocol.http.ParseState currentState, HttpServerExchange builder)  
      protected void handleAfterVersion​(java.nio.ByteBuffer buffer, io.undertow.server.protocol.http.ParseState state)  
      protected boolean handleCachedHeader​(java.lang.String existing, java.nio.ByteBuffer buffer, io.undertow.server.protocol.http.ParseState state, HttpServerExchange builder)  
      protected static java.util.Map<java.lang.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)
      • handleAfterVersion

        protected void handleAfterVersion​(java.nio.ByteBuffer buffer,
                                          io.undertow.server.protocol.http.ParseState state)
                                   throws BadRequestException
        Throws:
        BadRequestException
      • httpStrings

        protected static java.util.Map<java.lang.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: