Class BufferedCharSource
java.lang.Object
io.github.wasabithumb.jtoml.io.source.BufferedCharSource
- All Implemented Interfaces:
CharSource,Closeable,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()@Nullable StringfinishExpression(boolean comment) Reads past whitespace and comments until a newline or EOF is found@org.jetbrains.annotations.Range(from=-1L, to=65535L) intnext()charnextChar()intpeek()voidvoidbooleanReads past any and all whitespace before the first non-whitespace characterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.wasabithumb.jtoml.io.source.CharSource
next
-
Constructor Details
-
BufferedCharSource
-
-
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.TomlExceptionReads 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:
nextin interfaceCharSource- Throws:
io.github.wasabithumb.jtoml.except.TomlException
-
nextChar
public char nextChar() throws io.github.wasabithumb.jtoml.except.TomlException- Specified by:
nextCharin interfaceCharSource- Throws:
io.github.wasabithumb.jtoml.except.TomlException
-
close
public void close() throws io.github.wasabithumb.jtoml.except.TomlException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCharSource- Specified by:
closein interfaceCloseable- Throws:
io.github.wasabithumb.jtoml.except.TomlException
-