public final class ScannerImpl extends Object implements Scanner
Scanner produces tokens of the following types: STREAM-START STREAM-END DIRECTIVE(name, value) DOCUMENT-START DOCUMENT-END BLOCK-SEQUENCE-START BLOCK-MAPPING-START BLOCK-END FLOW-SEQUENCE-START FLOW-MAPPING-START FLOW-SEQUENCE-END FLOW-MAPPING-END BLOCK-ENTRY FLOW-ENTRY KEY VALUE ALIAS(value) ANCHOR(value) TAG(value) SCALAR(value, plain, style) Read comments in the Scanner code for more details.
Constructor and Description |
---|
ScannerImpl(StreamReader reader) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkToken(Token.ID... choices)
Check whether the next token is one of the given types.
|
boolean |
hasNext() |
Token |
next()
Return the next token, removing it from the queue.
|
Token |
peekToken()
Return the next token, but do not delete it from the queue.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
public ScannerImpl(StreamReader reader)
public boolean checkToken(Token.ID... choices)
checkToken
in interface Scanner
choices
- token IDs.true
if the next token can be assigned to a variable
of at least one of the given types. Returns false
if
no more tokens are available.public Token peekToken()
peekToken
in interface Scanner
Scanner.next()
Copyright © 2020 Hazelcast, Inc.. All rights reserved.