Class TokenData

java.lang.Object
org.jsoup.parser.TokenData

class TokenData extends Object
A value holder for Tokens, as the stream is Tokenized. Can hold a String or a StringBuilder.

The goal is to minimize String copies -- the tokenizer tries to read the entirety of the token's data in one it, and set that as the simple String value. But if it turns out we need to append, fall back to a StringBuilder, which we get out of the pool (to reduce the GC load).

  • Field Details

  • Constructor Details

    • TokenData

      TokenData()
  • Method Details

    • set

      void set(String str)
    • append

      void append(String str)
    • append

      void append(char c)
    • appendCodePoint

      void appendCodePoint(int codepoint)
    • flipToBuilder

      private void flipToBuilder()
    • hasData

      boolean hasData()
    • reset

      void reset()
    • value

      String value()
    • toString

      public String toString()
      Overrides:
      toString in class Object