Top Description Methods
org.yaml.snakeyaml.scanner

public Interface Scanner

Known Direct Implementers
org.yaml.snakeyaml.scanner.ScannerImpl
Imports
org.yaml.snakeyaml.tokens.Token

This interface represents an input stream of Tokens.

The parser and the scanner form together the 'Parse' step in the loading process (see chapter 3.1 of the YAML Specification).

See Also
org.yaml.snakeyaml.tokens.Token

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the next token is one of the given types. Returns false if no more tokens are available.
checkToken
(Token.ID...
token IDs to match with
choices
)

Check if the next token is one of the given types.

public Token

Returns:

the coming token
getToken
()

Returns the next token.

public Token

Returns:

The token that will be returned on the next call to getToken
peekToken
()

Return the next token, but do not delete it from the stream.

public void

Method Detail

checkTokenback to summary
public boolean checkToken(Token.ID... choices)

Check if the next token is one of the given types.

Parameters
choices:Token.ID[]

token IDs to match with

Returns:boolean

true if the next token is one of the given types. Returns false if no more tokens are available.

Exceptions
ScannerException:
Thrown in case of malformed input.
getTokenback to summary
public Token getToken()

Returns the next token.

The token will be removed from the stream. (Every invocation of this method must happen after calling either checkToken or peekToken()

Returns:Token

the coming token

Exceptions
ScannerException:
Thrown in case of malformed input.
IndexOutOfBoundsException:
if no more token left
peekTokenback to summary
public Token peekToken()

Return the next token, but do not delete it from the stream.

Returns:Token

The token that will be returned on the next call to getToken

Exceptions
ScannerException:
Thrown in case of malformed input.
IndexOutOfBoundsException:
if no more token left
resetDocumentIndexback to summary
public void resetDocumentIndex()