org.yaml.snakeyaml.scanner
Class ScannerImpl
java.lang.Object
org.yaml.snakeyaml.scanner.ScannerImpl
- All Implemented Interfaces:
- Scanner
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ESCAPE_REPLACEMENTS
public static final Map<Character,String> ESCAPE_REPLACEMENTS
ESCAPE_CODES
public static final Map<Character,Integer> ESCAPE_CODES
ScannerImpl
public ScannerImpl(StreamReader reader)
checkToken
public boolean checkToken(Token.ID... choices)
- Check if the next token is one of the given types.
- Specified by:
checkToken
in interface Scanner
- Parameters:
choices
- token IDs.
- Returns:
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.
peekToken
public Token peekToken()
- Return the next token, but do not delete if from the queue.
- Specified by:
peekToken
in interface Scanner
- Returns:
- The token that will be returned on the next call to
Scanner.getToken()
getToken
public Token getToken()
- Return the next token.
- Specified by:
getToken
in interface Scanner
Copyright © 2008-2011. All Rights Reserved.