Package org.eclipse.jetty.util
Class LegacyQuotedStringTokenizer
java.lang.Object
org.eclipse.jetty.util.LegacyQuotedStringTokenizer
- All Implemented Interfaces:
QuotedStringTokenizer
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.QuotedStringTokenizer
QuotedStringTokenizer.Builder
-
Field Summary
Fields inherited from interface org.eclipse.jetty.util.QuotedStringTokenizer
CSV
-
Method Summary
Modifier and TypeMethodDescriptionboolean
needsQuoting
(char c) void
quote
(Appendable buffer, String input) Quote a string into an Appendable, escaping any characters that need to be escaped.Quote a string.void
quoteIfNeeded
(StringBuilder buf, String str) Append into buf the provided string, adding quotes if needed.Tokenize the passed string into anIterator
of tokens split from the string by delimiters.Unquote a string and expand any escaped charactersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.QuotedStringTokenizer
quote
-
Method Details
-
tokenize
Description copied from interface:QuotedStringTokenizer
Tokenize the passed string into anIterator
of tokens split from the string by delimiters. Tokenization is done as the iterator is advanced.- Specified by:
tokenize
in interfaceQuotedStringTokenizer
- Parameters:
string
- The string to be tokenized- Returns:
- An iterator of token strings.
-
needsQuoting
public boolean needsQuoting(char c) - Specified by:
needsQuoting
in interfaceQuotedStringTokenizer
- Parameters:
c
- A character- Returns:
- True if a string containing the character should be quoted.
-
quoteIfNeeded
Description copied from interface:QuotedStringTokenizer
Quote a string. The string is quoted only if quoting is required due to embedded delimiters, quote characters or the empty string.- Specified by:
quoteIfNeeded
in interfaceQuotedStringTokenizer
- Parameters:
s
- The string to quote.- Returns:
- quoted string
-
quoteIfNeeded
Description copied from interface:QuotedStringTokenizer
Append into buf the provided string, adding quotes if needed.Quoting is determined if any of the characters in the
delim
are found in the inputstr
.- Specified by:
quoteIfNeeded
in interfaceQuotedStringTokenizer
- Parameters:
buf
- the buffer to append tostr
- the string to possibly quote
-
quote
Description copied from interface:QuotedStringTokenizer
Quote a string into an Appendable, escaping any characters that need to be escaped.- Specified by:
quote
in interfaceQuotedStringTokenizer
- Parameters:
buffer
- The Appendable to append the quoted and escaped string into.input
- The String to quote.
-
unquote
Description copied from interface:QuotedStringTokenizer
Unquote a string and expand any escaped characters- Specified by:
unquote
in interfaceQuotedStringTokenizer
- Parameters:
s
- The string to unquote.- Returns:
- unquoted string with escaped characters expanded.
-