Package org.yaml.snakeyaml.scanner
Class ScannerImpl
- java.lang.Object
-
- org.yaml.snakeyaml.scanner.ScannerImpl
-
- All Implemented Interfaces:
Scanner
public final class ScannerImpl extends java.lang.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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.Character,java.lang.Integer>ESCAPE_CODESstatic java.util.Map<java.lang.Character,java.lang.String>ESCAPE_REPLACEMENTS
-
Constructor Summary
Constructors Constructor Description ScannerImpl(StreamReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckToken(Token.ID... choices)Check if the next token is one of the given types.TokengetToken()Return the next token.TokenpeekToken()Return the next token, but do not delete if from the queue.
-
-
-
Constructor Detail
-
ScannerImpl
public ScannerImpl(StreamReader reader)
-
-
Method Detail
-
checkToken
public boolean checkToken(Token.ID... choices)
Check if the next token is one of the given types.- Specified by:
checkTokenin interfaceScanner- Parameters:
choices- token IDs.- Returns:
trueif the next token can be assigned to a variable of at least one of the given types. Returnsfalseif no more tokens are available.
-
peekToken
public Token peekToken()
Return the next token, but do not delete if from the queue.- Specified by:
peekTokenin interfaceScanner- Returns:
- The token that will be returned on the next call to
Scanner.getToken()
-
-