Class RFC9110QuotedStringTokenizer
java.lang.Object
org.eclipse.jetty.util.RFC9110QuotedStringTokenizer
- All Implemented Interfaces:
 QuotedStringTokenizer
An implementation of 
QuotedStringTokenizer with partial handling of
RFC9110 quoted-strings.
The deviation from the RFC is that characters are not enforced to be
qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text and it is expected
that the caller will enforce any character restrictions.- 
Nested Class Summary
Nested classes/interfaces inherited from interface QuotedStringTokenizer
QuotedStringTokenizer.Builder - 
Field Summary
Fields inherited from interface QuotedStringTokenizer
CSV - 
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisOptionalWhiteSpace(char c) booleanneedsQuoting(char c) voidquote(Appendable buffer, String input) Quote a string into an Appendable, escaping any characters that need to be escaped.Quote a string.voidquoteIfNeeded(StringBuilder buf, String str) Append into buf the provided string, adding quotes if needed.Tokenize the passed string into anIteratorof tokens split from the string by delimiters.toString()Unquote a string and expand any escaped charactersMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface QuotedStringTokenizer
quote 
- 
Method Details
- 
isOptionalWhiteSpace
protected boolean isOptionalWhiteSpace(char c)  - 
tokenize
Description copied from interface:QuotedStringTokenizerTokenize the passed string into anIteratorof tokens split from the string by delimiters. Tokenization is done as the iterator is advanced.- Specified by:
 tokenizein interfaceQuotedStringTokenizer- Parameters:
 string- The string to be tokenized- Returns:
 - An iterator of token strings.
 
 - 
quote
Description copied from interface:QuotedStringTokenizerQuote a string into an Appendable, escaping any characters that need to be escaped.- Specified by:
 quotein interfaceQuotedStringTokenizer- Parameters:
 buffer- The Appendable to append the quoted and escaped string into.input- The String to quote.
 - 
quoteIfNeeded
Description copied from interface:QuotedStringTokenizerQuote a string. The string is quoted only if quoting is required due to embedded delimiters, quote characters or the empty string.- Specified by:
 quoteIfNeededin interfaceQuotedStringTokenizer- Parameters:
 s- The string to quote.- Returns:
 - quoted string
 
 - 
quoteIfNeeded
Description copied from interface:QuotedStringTokenizerAppend into buf the provided string, adding quotes if needed.Quoting is determined if any of the characters in the
delimare found in the inputstr.- Specified by:
 quoteIfNeededin interfaceQuotedStringTokenizer- Parameters:
 buf- the buffer to append tostr- the string to possibly quote
 - 
needsQuoting
public boolean needsQuoting(char c) - Specified by:
 needsQuotingin interfaceQuotedStringTokenizer- Parameters:
 c- A character- Returns:
 - True if a string containing the character should be quoted.
 
 - 
unquote
Description copied from interface:QuotedStringTokenizerUnquote a string and expand any escaped characters- Specified by:
 unquotein interfaceQuotedStringTokenizer- Parameters:
 s- The string to unquote.- Returns:
 - unquoted string with escaped characters expanded.
 
 - 
toString
 
 -