Package com.vladsch.flexmark.parser
Class LightInlineParserImpl
- java.lang.Object
-
- com.vladsch.flexmark.parser.LightInlineParserImpl
-
- All Implemented Interfaces:
LightInlineParser
- Direct Known Subclasses:
InlineParserImpl
public class LightInlineParserImpl extends java.lang.Object implements LightInlineParser
-
-
Field Summary
Fields Modifier and Type Field Description protected Nodeblockprotected java.util.ArrayList<BasedSequence>currentTextprotected Documentdocumentprotected intindexprotected BasedSequenceinputprotected ParsingmyParsingprotected InlineParserOptionsoptions
-
Constructor Summary
Constructors Constructor Description LightInlineParserImpl(DataHolder dataOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendNode(@NotNull Node node)@NotNull TextappendSeparateText(@NotNull BasedSequence text)voidappendText(@NotNull BasedSequence text)voidappendText(@NotNull BasedSequence text, int beginIndex, int endIndex)booleanflushTextNode()@NotNull NodegetBlock()@NotNull java.util.ArrayList<BasedSequence>getCurrentText()@NotNull DocumentgetDocument()intgetIndex()@NotNull BasedSequencegetInput()@NotNull InlineParserOptionsgetOptions()@NotNull ParsinggetParsing()BasedSequencematch(java.util.regex.Pattern re)If RE matches at current index in the input, advance index and return the match; otherwise return null.java.util.regex.Matchermatcher(java.util.regex.Pattern re)If RE matches at current index in the input, advance index and return the match; otherwise return null.BasedSequence[]matchWithGroups(java.util.regex.Pattern re)If RE matches at current index in the input, advance index and return the match; otherwise return null.voidmoveNodes(@NotNull Node fromNode, @NotNull Node toNode)booleannonIndentSp()Parse zero or more non-indent spacescharpeek()charpeek(int ahead)voidsetBlock(@NotNull Node block)voidsetDocument(@NotNull Document document)voidsetIndex(int index)voidsetInput(BasedSequence input)booleansp()Parse zero or more spacesbooleanspnl()Parse zero or more space characters, including at most one newline and zero or more spaces.booleanspnlUrl()Parse zero or more space characters, including at one newline.@Nullable BasedSequencetoEOL()Parse to end of line, including EOL
-
-
-
Field Detail
-
options
protected final InlineParserOptions options
-
myParsing
protected final Parsing myParsing
-
block
protected Node block
-
input
protected BasedSequence input
-
index
protected int index
-
currentText
protected java.util.ArrayList<BasedSequence> currentText
-
document
protected Document document
-
-
Constructor Detail
-
LightInlineParserImpl
public LightInlineParserImpl(DataHolder dataOptions)
-
-
Method Detail
-
getCurrentText
@NotNull public @NotNull java.util.ArrayList<BasedSequence> getCurrentText()
- Specified by:
getCurrentTextin interfaceLightInlineParser
-
getInput
@NotNull public @NotNull BasedSequence getInput()
- Specified by:
getInputin interfaceLightInlineParser
-
setInput
public void setInput(BasedSequence input)
- Specified by:
setInputin interfaceLightInlineParser
-
getIndex
public int getIndex()
- Specified by:
getIndexin interfaceLightInlineParser
-
setIndex
public void setIndex(int index)
- Specified by:
setIndexin interfaceLightInlineParser
-
getDocument
@NotNull public @NotNull Document getDocument()
- Specified by:
getDocumentin interfaceLightInlineParser
-
setDocument
public void setDocument(@NotNull @NotNull Document document)- Specified by:
setDocumentin interfaceLightInlineParser
-
getOptions
@NotNull public @NotNull InlineParserOptions getOptions()
- Specified by:
getOptionsin interfaceLightInlineParser
-
getParsing
@NotNull public @NotNull Parsing getParsing()
- Specified by:
getParsingin interfaceLightInlineParser
-
getBlock
@NotNull public @NotNull Node getBlock()
- Specified by:
getBlockin interfaceLightInlineParser
-
setBlock
public void setBlock(@NotNull @NotNull Node block)- Specified by:
setBlockin interfaceLightInlineParser
-
moveNodes
public void moveNodes(@NotNull @NotNull Node fromNode, @NotNull @NotNull Node toNode)- Specified by:
moveNodesin interfaceLightInlineParser
-
appendText
public void appendText(@NotNull @NotNull BasedSequence text)- Specified by:
appendTextin interfaceLightInlineParser
-
appendText
public void appendText(@NotNull @NotNull BasedSequence text, int beginIndex, int endIndex)- Specified by:
appendTextin interfaceLightInlineParser
-
appendNode
public void appendNode(@NotNull @NotNull Node node)- Specified by:
appendNodein interfaceLightInlineParser
-
appendSeparateText
@NotNull public @NotNull Text appendSeparateText(@NotNull @NotNull BasedSequence text)
- Specified by:
appendSeparateTextin interfaceLightInlineParser
-
flushTextNode
public boolean flushTextNode()
- Specified by:
flushTextNodein interfaceLightInlineParser
-
match
public BasedSequence match(java.util.regex.Pattern re)
If RE matches at current index in the input, advance index and return the match; otherwise return null.- Specified by:
matchin interfaceLightInlineParser- Parameters:
re- pattern to match- Returns:
- sequence matched or null
-
matchWithGroups
public BasedSequence[] matchWithGroups(java.util.regex.Pattern re)
If RE matches at current index in the input, advance index and return the match; otherwise return null.- Specified by:
matchWithGroupsin interfaceLightInlineParser- Parameters:
re- pattern to match- Returns:
- sequence matched or null
-
matcher
public java.util.regex.Matcher matcher(java.util.regex.Pattern re)
If RE matches at current index in the input, advance index and return the match; otherwise return null.- Specified by:
matcherin interfaceLightInlineParser- Parameters:
re- pattern to match- Returns:
- matched matcher or null
-
peek
public char peek()
- Specified by:
peekin interfaceLightInlineParser- Returns:
- the char at the current input index, or
'\0'in case there are no more characters.
-
peek
public char peek(int ahead)
- Specified by:
peekin interfaceLightInlineParser
-
spnl
public boolean spnl()
Parse zero or more space characters, including at most one newline and zero or more spaces.- Specified by:
spnlin interfaceLightInlineParser- Returns:
- true
-
nonIndentSp
public boolean nonIndentSp()
Parse zero or more non-indent spaces- Specified by:
nonIndentSpin interfaceLightInlineParser- Returns:
- true
-
sp
public boolean sp()
Parse zero or more spaces- Specified by:
spin interfaceLightInlineParser- Returns:
- true
-
spnlUrl
public boolean spnlUrl()
Parse zero or more space characters, including at one newline.- Specified by:
spnlUrlin interfaceLightInlineParser- Returns:
- true
-
toEOL
@Nullable public @Nullable BasedSequence toEOL()
Parse to end of line, including EOL- Specified by:
toEOLin interfaceLightInlineParser- Returns:
- characters parsed or null if no end of line
-
-