Class ScannerImpl
java.lang.Object
org.snakeyaml.engine.v2.scanner.ScannerImpl
Scanner produces tokens of the following types: STREAM-START STREAM-END COMMENT 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 Summary
ConstructorsConstructorDescriptionScannerImpl(LoadSettings settings, StreamReader reader) CreateScannerImpl(StreamReader reader) Deprecated.it should be used with LoadSettingsScannerImpl(StreamReader reader, LoadSettings settings) Deprecated.use the other constructor with LoadSettings first -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckToken(Token.ID... choices) Check whether the next token is one of the given types.booleanhasNext()next()Return the next token, removing it from the queue.Return the next token, but do not delete it from the queue.voidSet the document index to 0 after a document endMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining, remove
-
Constructor Details
-
ScannerImpl
Deprecated.use the other constructor with LoadSettings first- Parameters:
reader- - the inputsettings- - configurable options
-
ScannerImpl
Create- Parameters:
settings- - configurable optionsreader- - the input
-
ScannerImpl
Deprecated.it should be used with LoadSettings- Parameters:
reader- - the input
-
-
Method Details
-
checkToken
Check whether the next token is one of the given types.- Specified by:
checkTokenin interfaceScanner- Parameters:
choices- token IDs to match with- Returns:
trueif the next token is one of the given types. Returnsfalseif no more tokens are available.
-
peekToken
Return the next token, but do not delete it from the queue.- Specified by:
peekTokenin interfaceScanner- Returns:
- The token that will be returned on the next call to
Scanner.next()
-
hasNext
-
next
-
resetDocumentIndex
public void resetDocumentIndex()Description copied from interface:ScannerSet the document index to 0 after a document end- Specified by:
resetDocumentIndexin interfaceScanner
-