public interface Scanner
Token
s.
The parser and the scanner form together the 'Parse' step in the loading process (see chapter 3.1 of the YAML Specification).
Token
Modifier and Type | Method and Description |
---|---|
boolean |
checkToken(Token.ID... choices)
Check if the next token is one of the given types.
|
Token |
getToken()
Returns the next token.
|
Token |
peekToken()
Return the next token, but do not delete it from the stream.
|
boolean 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()
getToken()
ScannerException
- Thrown in case of malformed input.java.lang.IndexOutOfBoundsException
- if no more token leftToken getToken()
The token will be removed from the stream. (Every invocation of this method must happen after
calling either checkToken(org.yaml.snakeyaml.tokens.Token.ID...)
or peekToken()
ScannerException
- Thrown in case of malformed input.java.lang.IndexOutOfBoundsException
- if no more token left