Top Fields Constructors Methods
jdk.internal.org.commonmark.parser.beta

public Class Scanner

extends Object
Class Inheritance
Imports
jdk.internal.org.commonmark.node.SourceSpan, jdk.internal.org.commonmark.parser.SourceLine, .SourceLines, jdk.internal.org.commonmark.text.CharMatcher, java.util.List

Field Summary

Modifier and TypeField and Description
public static final char
END

Character representing the end of input source (or outside of the text in case of the "previous" methods).

private int
private SourceLine
private int
private int
private final List<SourceLine>

Constructor Summary

AccessConstructor and Description
pack-priv
Scanner(List<SourceLine> lines, int lineIndex, int index)

Method Summary

Modifier and TypeMethod and Description
private void
checkPosition(int lineIndex, int index)

public int
find(char c)

public int
find(CharMatcher matcher)

public SourceLines
public boolean
public int
match(CharMatcher matcher)

public int
matchMultiple(char c)

public void
next()

public boolean

Returns:

true if matched and position was advanced, false otherwise
next
(char
the char to check (including newline characters)
c
)

Check if the specified char is next and advance the position.

public boolean

Returns:

true if matched and position was advanced, false otherwise
next
(String
the text content to match on a single line (excluding newline characters)
content
)

Check if we have the specified content on the line and advanced the position.

public static Scanner
of(SourceLines lines)

public char
peek()

public int
public int
public Position
private void
public void
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ENDback to summary
public static final char END

Character representing the end of input source (or outside of the text in case of the "previous" methods).

Note that we can use NULL to represent this because CommonMark does not allow those in the input (we replace them in the beginning of parsing).

indexback to summary
private int index
lineback to summary
private SourceLine line
lineIndexback to summary
private int lineIndex
lineLengthback to summary
private int lineLength
linesback to summary
private final List<SourceLine> lines

Constructor Detail

Scannerback to summary
pack-priv Scanner(List<SourceLine> lines, int lineIndex, int index)

Method Detail

checkPositionback to summary
private void checkPosition(int lineIndex, int index)
findback to summary
public int find(char c)
findback to summary
public int find(CharMatcher matcher)
getSourceback to summary
public SourceLines getSource(Position begin, Position end)
hasNextback to summary
public boolean hasNext()
matchback to summary
public int match(CharMatcher matcher)
matchMultipleback to summary
public int matchMultiple(char c)
nextback to summary
public void next()
nextback to summary
public boolean next(char c)

Check if the specified char is next and advance the position.

Parameters
c:char

the char to check (including newline characters)

Returns:boolean

true if matched and position was advanced, false otherwise

nextback to summary
public boolean next(String content)

Check if we have the specified content on the line and advanced the position. Note that if you want to match newline characters, use next(char).

Parameters
content:String

the text content to match on a single line (excluding newline characters)

Returns:boolean

true if matched and position was advanced, false otherwise

ofback to summary
public static Scanner of(SourceLines lines)
peekback to summary
public char peek()
peekCodePointback to summary
public int peekCodePoint()
peekPreviousCodePointback to summary
public int peekPreviousCodePoint()
positionback to summary
public Position position()
setLineback to summary
private void setLine(SourceLine line)
setPositionback to summary
public void setPosition(Position position)
whitespaceback to summary
public int whitespace()