Top Description Inners Fields Constructors Methods
org.eclipse.jetty.http2.parser

public Class HeaderParser

extends Object
Class Inheritance
Imports
java.nio.ByteBuffer, org.eclipse.jetty.http2.Flags, .RateControl, org.eclipse.jetty.http2.frames.Frame, .FrameType

The parser for the frame header of HTTP/2 frames.

See Also
Parser

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private final RateControl
private HeaderParser.State
private int
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the raw value of the headers flag bits
getFlags
()

Returns the raw value of the header flag bits.

public int
public int
public RateControl
public int
public boolean

Returns:

whether the flag is present
hasFlag
(int
the flag to test for presence
bit
)

Returns whether the given header flag is present.

public boolean

Returns:

true if the whole header bytes were parsed, false if not enough header bytes were present in the buffer
parse
(ByteBuffer
the buffer to parse
buffer
)

Parses the header bytes in the given buffer; only the header bytes are consumed, therefore when this method returns, the buffer may contain unconsumed bytes.

protected void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

cursorback to summary
private int cursor
flagsback to summary
private int flags
lengthback to summary
private int length
rateControlback to summary
private final RateControl rateControl
stateback to summary
private HeaderParser.State state
streamIdback to summary
private int streamId
typeback to summary
private int type

Constructor Detail

HeaderParserback to summary
public HeaderParser(RateControl rateControl)

Method Detail

getFlagsback to summary
public int getFlags()

Returns the raw value of the header flag bits.

Use hasFlag(int) to test for flag presence. This method should be used just to retrieve the raw value of all the flag bits.

Returns:int

the raw value of the headers flag bits

See Also
hasFlag(int)
getFrameTypeback to summary
public int getFrameType()
getLengthback to summary
public int getLength()
getRateControlback to summary
public RateControl getRateControl()
getStreamIdback to summary
public int getStreamId()
hasFlagback to summary
public boolean hasFlag(int bit)

Returns whether the given header flag is present.

Parameters
bit:int

the flag to test for presence

Returns:boolean

whether the flag is present

parseback to summary
public boolean parse(ByteBuffer buffer)

Parses the header bytes in the given buffer; only the header bytes are consumed, therefore when this method returns, the buffer may contain unconsumed bytes.

Parameters
buffer:ByteBuffer

the buffer to parse

Returns:boolean

true if the whole header bytes were parsed, false if not enough header bytes were present in the buffer

resetback to summary
protected void reset()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.eclipse.jetty.http2.parser back to summary

private final Enum HeaderParser.State

extends Enum<HeaderParser.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final HeaderParser.State
public static final HeaderParser.State
public static final HeaderParser.State
public static final HeaderParser.State
public static final HeaderParser.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static HeaderParser.State
public static HeaderParser.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

FLAGSback to summary
public static final HeaderParser.State FLAGS
LENGTHback to summary
public static final HeaderParser.State LENGTH
STREAM_IDback to summary
public static final HeaderParser.State STREAM_ID
STREAM_ID_BYTESback to summary
public static final HeaderParser.State STREAM_ID_BYTES
TYPEback to summary
public static final HeaderParser.State TYPE

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static HeaderParser.State valueOf(String name)
valuesback to summary
public static HeaderParser.State[] values()