- java.lang.Object
-
- org.commonmark.parser.block.BlockStart
-
- org.commonmark.internal.BlockStartImpl
-
public class BlockStartImpl extends BlockStart
-
-
Field Summary
Fields Modifier and Type Field Description private BlockParser[]blockParsersprivate intnewColumnprivate intnewIndexprivate booleanreplaceActiveBlockParserprivate intreplaceParagraphLines
-
Constructor Summary
Constructors Constructor Description BlockStartImpl(BlockParser... blockParsers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockStartatColumn(int newColumn)Continue parsing at the specified column (for tab handling).BlockStartatIndex(int newIndex)Continue parsing at the specified index.BlockParser[]getBlockParsers()intgetNewColumn()intgetNewIndex()(package private) intgetReplaceParagraphLines()booleanisReplaceActiveBlockParser()BlockStartreplaceActiveBlockParser()BlockStartreplaceParagraphLines(int lines)Replace a number of lines from the current paragraph (as returned byMatchedBlockParser.getParagraphLines()) with the new block.-
Methods inherited from class org.commonmark.parser.block.BlockStart
none, of
-
-
-
-
Field Detail
-
blockParsers
private final BlockParser[] blockParsers
-
newIndex
private int newIndex
-
newColumn
private int newColumn
-
replaceActiveBlockParser
private boolean replaceActiveBlockParser
-
replaceParagraphLines
private int replaceParagraphLines
-
-
Constructor Detail
-
BlockStartImpl
public BlockStartImpl(BlockParser... blockParsers)
-
-
Method Detail
-
getBlockParsers
public BlockParser[] getBlockParsers()
-
getNewIndex
public int getNewIndex()
-
getNewColumn
public int getNewColumn()
-
isReplaceActiveBlockParser
public boolean isReplaceActiveBlockParser()
-
getReplaceParagraphLines
int getReplaceParagraphLines()
-
atIndex
public BlockStart atIndex(int newIndex)
Description copied from class:BlockStartContinue parsing at the specified index.- Specified by:
atIndexin classBlockStart- Parameters:
newIndex- the new index, seeParserState.getIndex()
-
atColumn
public BlockStart atColumn(int newColumn)
Description copied from class:BlockStartContinue parsing at the specified column (for tab handling).- Specified by:
atColumnin classBlockStart- Parameters:
newColumn- the new column, seeParserState.getColumn()
-
replaceActiveBlockParser
public BlockStart replaceActiveBlockParser()
- Specified by:
replaceActiveBlockParserin classBlockStart
-
replaceParagraphLines
public BlockStart replaceParagraphLines(int lines)
Description copied from class:BlockStartReplace a number of lines from the current paragraph (as returned byMatchedBlockParser.getParagraphLines()) with the new block.This is useful for parsing blocks that start with normal paragraphs and only have special marker syntax in later lines, e.g. in this:
Foo ===
TheFooline is initially parsed as a normal paragraph, then===is parsed as a heading marker, replacing the 1 paragraph line before. The end result is a single Heading block.Note that source spans from the replaced lines are automatically added to the new block.
- Specified by:
replaceParagraphLinesin classBlockStart- Parameters:
lines- the number of lines to replace (at least 1); useInteger.MAX_VALUEto replace the whole paragraph
-
-