public interface Scanner extends Iterator<Token>
Tokens.
The scanner and the parser form together the 'Parse' step in the loading process.
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkToken(Token.ID... choices)
Check if the next token is one of the given types.
|
Token |
next()
Returns the next token.
|
Token |
peekToken()
Return the next token, but do not delete it from the stream.
|
forEachRemaining, hasNext, removeboolean checkToken(Token.ID... choices)
choices - token IDs to match withtrue if the next token is one of the given types.
Returns false if no more tokens are available.ScannerException - Thrown in case of malformed input.Token peekToken()
next()ScannerException - Thrown in case of malformed input.IndexOutOfBoundsException - if no more token leftToken next()
The token will be removed from the stream. (Every invocation of this method must happen after
calling either checkToken(org.snakeyaml.engine.v2.tokens.Token.ID...) or peekToken()
next in interface Iterator<Token>ScannerException - Thrown in case of malformed input.IndexOutOfBoundsException - if no more token leftCopyright © 2018–2022. All rights reserved.