Package org.eclipse.jetty.util
Class QuotedStringTokenizer.Builder
java.lang.Object
org.eclipse.jetty.util.QuotedStringTokenizer.Builder
- Enclosing interface:
- QuotedStringTokenizer
-
Method Summary
Modifier and TypeMethodDescriptionIf called, the builtQuotedStringTokenizer
will interpret quote characters within a token as initiating a sequence of quoted characters, rather than being part of the token value itself.If called, the builtQuotedStringTokenizer
will only allow escapes to be used with the quote character.If called, the builtQuotedStringTokenizer
will allow quoting with the single quote character'
.build()
delimiters
(String delim) If called, the builtQuotedStringTokenizer
will ignore optional white space characters before and after delimiters.legacy()
If called, the builtQuotedStringTokenizer
will use the legacy implementation from prior to jetty-12.If called, the builtQuotedStringTokenizer
will return delimiter characters as individual tokens.If called, the builtQuotedStringTokenizer
will return tokens with quotes interpreted but not removed.
-
Method Details
-
delimiters
- Parameters:
delim
- A string containing the set of characters that are considered delimiters.- Returns:
- this
Builder
-
returnQuotes
If called, the builtQuotedStringTokenizer
will return tokens with quotes interpreted but not removed.- Returns:
- this
Builder
-
returnDelimiters
If called, the builtQuotedStringTokenizer
will return delimiter characters as individual tokens.- Returns:
- this
Builder
-
ignoreOptionalWhiteSpace
If called, the builtQuotedStringTokenizer
will ignore optional white space characters before and after delimiters. This is not supported together withlegacy()
. For example, the stringa, b ,c
with delimiter,
will be tokenized with this option asa
,b
andc
, all trimmed of spaces. Without this option, the second token would beb
with one space before and after.- Returns:
- this
Builder
-
allowEmbeddedQuotes
If called, the builtQuotedStringTokenizer
will interpret quote characters within a token as initiating a sequence of quoted characters, rather than being part of the token value itself. For example the stringname1=value1; name2="value;2"
with;
delimiter, would result in two tokens:name1=value1
andname2=value;2
. Without this option the result would be three tokens:name1=value1
,name2="value
and2"
.- Returns:
- this
Builder
-
allowSingleQuote
If called, the builtQuotedStringTokenizer
will allow quoting with the single quote character'
. This can only be used withlegacy()
.- Returns:
- this
Builder
-
allowEscapeOnlyForQuotes
If called, the builtQuotedStringTokenizer
will only allow escapes to be used with the quote character. Specifically the escape character itself cannot be escaped. Any usage of the escape character, other than for quotes, is considered as a literal escape character. For example the string"test\"tokenizer\test"
will be unquoted astest"tokenizer\test
.- Returns:
- this
Builder
-
legacy
If called, the builtQuotedStringTokenizer
will use the legacy implementation from prior to jetty-12. The legacy implementation does not comply with any current RFC. Usinglegacy
also impliesallowEmbeddedQuotes()
.- Returns:
- this
Builder
-
build
- Returns:
- The built immutable
QuotedStringTokenizer
.
-