Top Description Fields Constructors Methods
org.apache.hc.core5.http.message

public Class TokenParser

extends Tokenizer
Class Inheritance
Annotations
@Deprecated
@Contract
threading:IMMUTABLE
Imports
java.util.BitSet, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.util.Tokenizer

Deprecated

Use Tokenizer

Low level parser for header field elements. The parsing routines of this class are designed to produce near zero intermediate garbage and make no intermediate copies of input data.

This class is immutable and thread safe.

Since
4.4

Field Summary

Modifier and TypeField and Description
public static final char
public static final char
ESCAPE

Hides org.apache.hc.core5.util.Tokenizer.ESCAPE.

Backward slash / escape character
public static final TokenParser
INSTANCE

Hides org.apache.hc.core5.util.Tokenizer.INSTANCE.

Deprecated as a consequence of TokenParser being deprecated.
Inherited from org.apache.hc.core5.util.Tokenizer:
CRHTLFSP

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
copyContent(final CharSequence buf, final ParserCursor cursor, final BitSet delimiters, final StringBuilder dst)

public void
copyContent(final CharSequence
buffer with the sequence of chars to be parsed
buf
,
final Tokenizer.Cursor
defines the bounds and current position of the buffer
cursor
,
final BitSet
set of delimiting characters. Can be null if the value is delimited by a whitespace only.
delimiters
,
final StringBuilder
destination buffer
dst
)

Overrides org.apache.hc.core5.util.Tokenizer.copyContent.

Transfers content into the destination buffer until a whitespace character or any of the given delimiters is encountered.
public void
copyQuotedContent(final CharSequence buf, final ParserCursor cursor, final StringBuilder dst)

public void
copyQuotedContent(final CharSequence
buffer with the sequence of chars to be parsed
buf
,
final Tokenizer.Cursor
defines the bounds and current position of the buffer
cursor
,
final StringBuilder
destination buffer
dst
)

Overrides org.apache.hc.core5.util.Tokenizer.copyQuotedContent.

Transfers content enclosed with quote marks into the destination buffer.
public void
copyUnquotedContent(final CharSequence buf, final ParserCursor cursor, final BitSet delimiters, final StringBuilder dst)

public void
copyUnquotedContent(final CharSequence
buffer with the sequence of chars to be parsed
buf
,
final Tokenizer.Cursor
defines the bounds and current position of the buffer
cursor
,
final BitSet
set of delimiting characters. Can be null if the value is delimited by a whitespace or a quote only.
delimiters
,
final StringBuilder
destination buffer
dst
)

Overrides org.apache.hc.core5.util.Tokenizer.copyUnquotedContent.

Transfers content into the destination buffer until a whitespace character, a quote, or any of the given delimiters is encountered.
public String
parseToken(final CharSequence buf, final ParserCursor cursor, final BitSet delimiters)

public String
parseValue(final CharSequence buf, final ParserCursor cursor, final BitSet delimiters)

public void
skipWhiteSpace(final CharSequence buf, final ParserCursor cursor)

Inherited from org.apache.hc.core5.util.Tokenizer:
INIT_BITSETisWhitespaceparseContentparseTokenparseValueskipWhiteSpace

Field Detail

DQUOTEback to summary
public static final char DQUOTE

Hides org.apache.hc.core5.util.Tokenizer.DQUOTE.

Double quote

ESCAPEback to summary
public static final char ESCAPE

Hides org.apache.hc.core5.util.Tokenizer.ESCAPE.

Backward slash / escape character

INSTANCEback to summary
public static final TokenParser INSTANCE

Hides org.apache.hc.core5.util.Tokenizer.INSTANCE.

Deprecated

as a consequence of TokenParser being deprecated. See corresponding docs for further information.

Constructor Detail

TokenParserback to summary
public TokenParser()

Method Detail

copyContentback to summary
public void copyContent(final CharSequence buf, final ParserCursor cursor, final BitSet delimiters, final StringBuilder dst)
copyContentback to summary
public void copyContent(final CharSequence buf, final Tokenizer.Cursor cursor, final BitSet delimiters, final StringBuilder dst)

Overrides org.apache.hc.core5.util.Tokenizer.copyContent.

Doc from org.apache.hc.core5.util.Tokenizer.copyContent.

Transfers content into the destination buffer until a whitespace character or any of the given delimiters is encountered.

Parameters
buf:CharSequence

buffer with the sequence of chars to be parsed

cursor:Tokenizer.Cursor

defines the bounds and current position of the buffer

delimiters:BitSet

set of delimiting characters. Can be null if the value is delimited by a whitespace only.

dst:StringBuilder

destination buffer

Annotations
@Override
copyQuotedContentback to summary
public void copyQuotedContent(final CharSequence buf, final ParserCursor cursor, final StringBuilder dst)
copyQuotedContentback to summary
public void copyQuotedContent(final CharSequence buf, final Tokenizer.Cursor cursor, final StringBuilder dst)

Overrides org.apache.hc.core5.util.Tokenizer.copyQuotedContent.

Doc from org.apache.hc.core5.util.Tokenizer.copyQuotedContent.

Transfers content enclosed with quote marks into the destination buffer.

Parameters
buf:CharSequence

buffer with the sequence of chars to be parsed

cursor:Tokenizer.Cursor

defines the bounds and current position of the buffer

dst:StringBuilder

destination buffer

Annotations
@Override
copyUnquotedContentback to summary
public void copyUnquotedContent(final CharSequence buf, final ParserCursor cursor, final BitSet delimiters, final StringBuilder dst)
copyUnquotedContentback to summary
public void copyUnquotedContent(final CharSequence buf, final Tokenizer.Cursor cursor, final BitSet delimiters, final StringBuilder dst)

Overrides org.apache.hc.core5.util.Tokenizer.copyUnquotedContent.

Doc from org.apache.hc.core5.util.Tokenizer.copyUnquotedContent.

Transfers content into the destination buffer until a whitespace character, a quote, or any of the given delimiters is encountered.

Parameters
buf:CharSequence

buffer with the sequence of chars to be parsed

cursor:Tokenizer.Cursor

defines the bounds and current position of the buffer

delimiters:BitSet

set of delimiting characters. Can be null if the value is delimited by a whitespace or a quote only.

dst:StringBuilder

destination buffer

Annotations
@Override
parseTokenback to summary
public String parseToken(final CharSequence buf, final ParserCursor cursor, final BitSet delimiters)
parseValueback to summary
public String parseValue(final CharSequence buf, final ParserCursor cursor, final BitSet delimiters)
skipWhiteSpaceback to summary
public void skipWhiteSpace(final CharSequence buf, final ParserCursor cursor)