Enum HttpHeaderParser.HeaderParsePosition
- java.lang.Object
-
- java.lang.Enum<HttpHeaderParser.HeaderParsePosition>
-
- org.apache.tomcat.util.http.parser.HttpHeaderParser.HeaderParsePosition
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<HttpHeaderParser.HeaderParsePosition>
- Enclosing class:
- HttpHeaderParser
public static enum HttpHeaderParser.HeaderParsePosition extends java.lang.Enum<HttpHeaderParser.HeaderParsePosition>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description HEADER_MULTI_LINE
Before reading a new line of a header.HEADER_NAME
Reading a header name.HEADER_SKIPLINE
Reading all bytes until the next CRLF.HEADER_START
Start of a new header.HEADER_VALUE
Reading the header value.HEADER_VALUE_START
Skipping whitespace before text of header value starts, either on the first line of header value (just after ':') or on subsequent lines when it is known that subsequent line starts with SP or HT.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HttpHeaderParser.HeaderParsePosition
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static HttpHeaderParser.HeaderParsePosition[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HEADER_START
public static final HttpHeaderParser.HeaderParsePosition HEADER_START
Start of a new header. A CRLF here means that there are no more headers. Any other character starts a header name.
-
HEADER_NAME
public static final HttpHeaderParser.HeaderParsePosition HEADER_NAME
Reading a header name. All characters of header are HTTP_TOKEN_CHAR. Header name is followed by ':'. No whitespace is allowed.
Any non-HTTP_TOKEN_CHAR (this includes any whitespace) encountered before ':' will result in the whole line being ignored.
-
HEADER_VALUE_START
public static final HttpHeaderParser.HeaderParsePosition HEADER_VALUE_START
Skipping whitespace before text of header value starts, either on the first line of header value (just after ':') or on subsequent lines when it is known that subsequent line starts with SP or HT.
-
HEADER_VALUE
public static final HttpHeaderParser.HeaderParsePosition HEADER_VALUE
Reading the header value. We are inside the value. Either on the first line or on any subsequent line. We come into this state from HEADER_VALUE_START after the first non-SP/non-HT byte is encountered on the line.
-
HEADER_MULTI_LINE
public static final HttpHeaderParser.HeaderParsePosition HEADER_MULTI_LINE
Before reading a new line of a header. Once the next byte is peeked, the state changes without advancing our position. The state becomes either HEADER_VALUE_START (if that first byte is SP or HT), or HEADER_START (otherwise).
-
HEADER_SKIPLINE
public static final HttpHeaderParser.HeaderParsePosition HEADER_SKIPLINE
Reading all bytes until the next CRLF. The line is being ignored.
-
-
Method Detail
-
values
public static HttpHeaderParser.HeaderParsePosition[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HttpHeaderParser.HeaderParsePosition c : HttpHeaderParser.HeaderParsePosition.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpHeaderParser.HeaderParsePosition valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-