Package org.yaml.snakeyaml.scanner
Class ScannerImpl
java.lang.Object
org.yaml.snakeyaml.scanner.ScannerImpl
- All Implemented Interfaces:
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionA mapping from a character to a number of bytes to read-ahead for that escape sequence.A mapping from an escaped character in the input stream to the string representation that they should be replaced with. -
Constructor Summary
ConstructorsConstructorDescriptionScannerImpl
(StreamReader reader) Deprecated.use options insteadScannerImpl
(StreamReader reader, LoaderOptions options) -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkToken
(Token.ID... choices) Check whether the next token is one of the given types.getToken()
Return the next token, removing it from the queue.boolean
Deprecated.Return the next token, but do not delete it from the queue.setParseComments
(boolean parseComments) Deprecated.
-
Field Details
-
ESCAPE_REPLACEMENTS
A mapping from an escaped character in the input stream to the string representation that they should be replaced with. YAML defines several common and a few uncommon escape sequences.- See Also:
-
ESCAPE_CODES
A mapping from a character to a number of bytes to read-ahead for that escape sequence. These escape sequences are used to handle unicode escaping in the following formats, where H is a hexadecimal character:\xHH : escaped 8-bit Unicode character \uHHHH : escaped 16-bit Unicode character \UHHHHHHHH : escaped 32-bit Unicode character
- See Also:
-
-
Constructor Details
-
ScannerImpl
Deprecated.use options insteadCreate- Parameters:
reader
-
-
ScannerImpl
-
-
Method Details
-
setParseComments
Deprecated.Please use LoaderOptions instead Set the scanner to ignore comments or parse them as aCommentToken
.- Parameters:
parseComments
-true
to parse;false
to ignore
-
isParseComments
Deprecated. -
checkToken
Check whether the next token is one of the given types.- Specified by:
checkToken
in interfaceScanner
- Parameters:
choices
- token IDs to match with- Returns:
true
if the next token is one of the given types. Returnsfalse
if no more tokens are available.
-
peekToken
Return the next token, but do not delete it from the queue.- Specified by:
peekToken
in interfaceScanner
- Returns:
- The token that will be returned on the next call to
Scanner.getToken()
-
getToken
Return the next token, removing it from the queue.
-