Class TokenBuffer

java.lang.Object
com.yahoo.document.json.TokenBuffer
Direct Known Subclasses:
LazyTokenBuffer

public class TokenBuffer extends Object
Helper class to enable lookahead in the token stream.
Author:
Steinar Knutsen
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bufferObject(com.fasterxml.jackson.core.JsonParser parser)
     
    com.fasterxml.jackson.core.JsonToken
    Returns the current token without changing position, or null if none
    Returns the current token name without changing position, or null if none
    Returns the current token text without changing position, or null if none
    boolean
    Returns whether any tokens are available in this
    Returns a sequence of remaining tokens in this, or nulls when none remain.
    int
     
    com.fasterxml.jackson.core.JsonToken
    Returns the next token, or null, and updates the nesting count of this.
    void
    skipToRelativeNesting(int relativeNesting)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TokenBuffer

      public TokenBuffer()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns whether any tokens are available in this
    • next

      public com.fasterxml.jackson.core.JsonToken next()
      Returns the next token, or null, and updates the nesting count of this.
    • current

      public com.fasterxml.jackson.core.JsonToken current()
      Returns the current token without changing position, or null if none
    • currentName

      public String currentName()
      Returns the current token name without changing position, or null if none
    • currentText

      public String currentText()
      Returns the current token text without changing position, or null if none
    • lookahead

      public Supplier<TokenBuffer.Token> lookahead()
      Returns a sequence of remaining tokens in this, or nulls when none remain. This may fill the token buffer, but not otherwise modify it.
    • bufferObject

      public void bufferObject(com.fasterxml.jackson.core.JsonParser parser)
    • nesting

      public int nesting()
    • skipToRelativeNesting

      public void skipToRelativeNesting(int relativeNesting)