Package org.snakeyaml.engine.v2.scanner
Interface Scanner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancheckToken(Token.ID... choices)Check if the next token is one of the given types.Tokennext()Returns the next token.TokenpeekToken()Return the next token, but do not delete it from the stream.-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, remove
-
-
-
-
Method Detail
-
checkToken
boolean checkToken(Token.ID... choices)
Check if the next token is one of the given types.- Parameters:
choices- token IDs.- Returns:
trueif the next token can be assigned to a variable of at least one of the given types. Returnsfalseif no more tokens are available.- Throws:
ScannerException- Thrown in case of malformed input.
-
peekToken
Token peekToken()
Return the next token, but do not delete it from the stream. The method must be called only aftercheckToken(org.snakeyaml.engine.v2.tokens.Token.ID...).- Returns:
- The token that will be returned on the next call to
next() - Throws:
ScannerException- Thrown in case of malformed input.IndexOutOfBoundsException- if no more token left
-
next
Token next()
Returns the next token.The token will be removed from the stream. (Every invocation of this method must happen after calling
checkToken(org.snakeyaml.engine.v2.tokens.Token.ID...).- Specified by:
nextin interfaceIterator<Token>- Returns:
- the coming token
- Throws:
ScannerException- Thrown in case of malformed input.IndexOutOfBoundsException- if no more token left
-
-