Class BufferedCharSource

java.lang.Object
io.github.wasabithumb.jtoml.io.source.BufferedCharSource
All Implemented Interfaces:
CharSource, Closeable, AutoCloseable

public final class BufferedCharSource extends Object implements CharSource
  • Constructor Details

    • BufferedCharSource

      public BufferedCharSource(@NotNull @NotNull CharSource backing)
  • Method Details

    • peek

      public int peek() throws io.github.wasabithumb.jtoml.except.TomlException
      Throws:
      io.github.wasabithumb.jtoml.except.TomlException
    • skipWhitespace

      public boolean skipWhitespace() throws io.github.wasabithumb.jtoml.except.TomlException
      Reads past any and all whitespace before the first non-whitespace character
      Returns:
      False if EOF
      Throws:
      io.github.wasabithumb.jtoml.except.TomlException
    • finishExpression

      @Contract("true -> !null") @Nullable public @Nullable String finishExpression(boolean comment) throws io.github.wasabithumb.jtoml.except.TomlException
      Reads past whitespace and comments until a newline or EOF is found
      Parameters:
      comment - True if known to be inside a comment. If false, comments may still be entered.
      Returns:
      The comment read, if any
      Throws:
      io.github.wasabithumb.jtoml.except.TomlException
    • raise

      @Contract("_ -> fail") public void raise(@NotNull @NotNull String message) throws io.github.wasabithumb.jtoml.except.parse.TomlLocalParseException
      Throws:
      io.github.wasabithumb.jtoml.except.parse.TomlLocalParseException
    • raise

      @Contract("_, _ -> fail") public void raise(@NotNull @NotNull String message, @Nullable @Nullable Throwable cause) throws io.github.wasabithumb.jtoml.except.parse.TomlLocalParseException
      Throws:
      io.github.wasabithumb.jtoml.except.parse.TomlLocalParseException
    • next

      public @org.jetbrains.annotations.Range(from=-1L, to=65535L) int next() throws io.github.wasabithumb.jtoml.except.TomlException
      Specified by:
      next in interface CharSource
      Throws:
      io.github.wasabithumb.jtoml.except.TomlException
    • nextChar

      public char nextChar() throws io.github.wasabithumb.jtoml.except.TomlException
      Specified by:
      nextChar in interface CharSource
      Throws:
      io.github.wasabithumb.jtoml.except.TomlException
    • close

      public void close() throws io.github.wasabithumb.jtoml.except.TomlException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface CharSource
      Specified by:
      close in interface Closeable
      Throws:
      io.github.wasabithumb.jtoml.except.TomlException