Class QuotedStringTokenizer.Builder

java.lang.Object
org.eclipse.jetty.util.QuotedStringTokenizer.Builder
Enclosing interface:
QuotedStringTokenizer

public static class QuotedStringTokenizer.Builder extends Object
  • Method Details

    • delimiters

      public QuotedStringTokenizer.Builder delimiters(String delim)
      Parameters:
      delim - A string containing the set of characters that are considered delimiters.
      Returns:
      this Builder
    • returnQuotes

      public QuotedStringTokenizer.Builder returnQuotes()
      If called, the built QuotedStringTokenizer will return tokens with quotes interpreted but not removed.
      Returns:
      this Builder
    • returnDelimiters

      public QuotedStringTokenizer.Builder returnDelimiters()
      If called, the built QuotedStringTokenizer will return delimiter characters as individual tokens.
      Returns:
      this Builder
    • ignoreOptionalWhiteSpace

      public QuotedStringTokenizer.Builder ignoreOptionalWhiteSpace()
      If called, the built QuotedStringTokenizer will ignore optional white space characters before and after delimiters. This is not supported together with legacy(). For example, the string a, b ,c with delimiter , will be tokenized with this option as a, b and c, all trimmed of spaces. Without this option, the second token would be b with one space before and after.
      Returns:
      this Builder
    • allowEmbeddedQuotes

      public QuotedStringTokenizer.Builder allowEmbeddedQuotes()
      If called, the built QuotedStringTokenizer 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 string name1=value1; name2="value;2" with ; delimiter, would result in two tokens: name1=value1 and name2=value;2. Without this option the result would be three tokens: name1=value1, name2="value and 2".
      Returns:
      this Builder
    • allowSingleQuote

      public QuotedStringTokenizer.Builder allowSingleQuote()
      If called, the built QuotedStringTokenizer will allow quoting with the single quote character '. This can only be used with legacy().
      Returns:
      this Builder
    • allowEscapeOnlyForQuotes

      public QuotedStringTokenizer.Builder allowEscapeOnlyForQuotes()
      If called, the built QuotedStringTokenizer 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 as test"tokenizer\test.
      Returns:
      this Builder
    • legacy

      If called, the built QuotedStringTokenizer will use the legacy implementation from prior to jetty-12. The legacy implementation does not comply with any current RFC. Using legacy also implies allowEmbeddedQuotes().
      Returns:
      this Builder
    • build

      public QuotedStringTokenizer build()
      Returns:
      The built immutable QuotedStringTokenizer.