Package org.snakeyaml.engine.v2.scanner
Class ScannerImpl
- java.lang.Object
-
- org.snakeyaml.engine.v2.scanner.ScannerImpl
-
public final class ScannerImpl extends Object implements Scanner
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
Constructors Constructor Description ScannerImpl(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckToken(org.snakeyaml.engine.v2.tokens.Token.ID... choices)Check whether the next token is one of the given types.booleanhasNext()org.snakeyaml.engine.v2.tokens.Tokennext()Return the next token, removing it from the queue.org.snakeyaml.engine.v2.tokens.TokenpeekToken()Return the next token, but do not delete it from the queue.voidresetDocumentIndex()Set the document index to 0 after a document end-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
ScannerImpl
@Deprecated public ScannerImpl(StreamReader reader, LoadSettings settings)
Deprecated.use the other constructor with LoadSettings first- Parameters:
reader- - the inputsettings- - configurable options
-
ScannerImpl
public ScannerImpl(LoadSettings settings, StreamReader reader)
Create- Parameters:
settings- - configurable optionsreader- - the input
-
ScannerImpl
@Deprecated public ScannerImpl(StreamReader reader)
Deprecated.it should be used with LoadSettings- Parameters:
reader- - the input
-
-
Method Detail
-
checkToken
public boolean checkToken(org.snakeyaml.engine.v2.tokens.Token.ID... choices)
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
public org.snakeyaml.engine.v2.tokens.Token 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
public boolean hasNext()
-
next
public org.snakeyaml.engine.v2.tokens.Token next()
Return the next token, removing it from the queue.
-
resetDocumentIndex
public void resetDocumentIndex()
Description copied from interface:ScannerSet the document index to 0 after a document end- Specified by:
resetDocumentIndexin interfaceScanner
-
-