Class LegacyQuotedStringTokenizer

java.lang.Object
org.eclipse.jetty.util.LegacyQuotedStringTokenizer
All Implemented Interfaces:
QuotedStringTokenizer

public class LegacyQuotedStringTokenizer extends Object implements QuotedStringTokenizer
  • Method Details

    • tokenize

      public Iterator<String> tokenize(String string)
      Description copied from interface: QuotedStringTokenizer
      Tokenize the passed string into an Iterator of tokens split from the string by delimiters. Tokenization is done as the iterator is advanced.
      Specified by:
      tokenize in interface QuotedStringTokenizer
      Parameters:
      string - The string to be tokenized
      Returns:
      An iterator of token strings.
    • needsQuoting

      public boolean needsQuoting(char c)
      Specified by:
      needsQuoting in interface QuotedStringTokenizer
      Parameters:
      c - A character
      Returns:
      True if a string containing the character should be quoted.
    • quoteIfNeeded

      public String quoteIfNeeded(String s)
      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 interface QuotedStringTokenizer
      Parameters:
      s - The string to quote.
      Returns:
      quoted string
    • quoteIfNeeded

      public void quoteIfNeeded(StringBuilder buf, String str)
      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 input str.

      Specified by:
      quoteIfNeeded in interface QuotedStringTokenizer
      Parameters:
      buf - the buffer to append to
      str - the string to possibly quote
    • quote

      public void quote(Appendable buffer, String input)
      Description copied from interface: QuotedStringTokenizer
      Quote a string into an Appendable, escaping any characters that need to be escaped.
      Specified by:
      quote in interface QuotedStringTokenizer
      Parameters:
      buffer - The Appendable to append the quoted and escaped string into.
      input - The String to quote.
    • unquote

      public String unquote(String s)
      Description copied from interface: QuotedStringTokenizer
      Unquote a string and expand any escaped characters
      Specified by:
      unquote in interface QuotedStringTokenizer
      Parameters:
      s - The string to unquote.
      Returns:
      unquoted string with escaped characters expanded.