Package org.commonmark.internal
Class FencedCodeBlockParser
- java.lang.Object
-
- org.commonmark.parser.block.AbstractBlockParser
-
- org.commonmark.internal.FencedCodeBlockParser
-
- All Implemented Interfaces:
BlockParser
public class FencedCodeBlockParser extends AbstractBlockParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFencedCodeBlockParser.Factory
-
Field Summary
Fields Modifier and Type Field Description private FencedCodeBlockblockprivate charfenceCharprivate java.lang.StringfirstLineprivate intopeningFenceLengthprivate java.lang.StringBuilderotherLines
-
Constructor Summary
Constructors Constructor Description FencedCodeBlockParser(char fenceChar, int fenceLength, int fenceIndent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLine(SourceLine line)Add the part of a line that belongs to this block parser to parse (i.e.private static FencedCodeBlockParsercheckOpener(java.lang.CharSequence line, int index, int indent)voidcloseBlock()BlockgetBlock()private booleantryClosing(java.lang.CharSequence line, int index)BlockContinuetryContinue(ParserState state)-
Methods inherited from class org.commonmark.parser.block.AbstractBlockParser
addSourceSpan, canContain, canHaveLazyContinuationLines, getDefinitions, isContainer, parseInlines
-
-
-
-
Field Detail
-
block
private final FencedCodeBlock block
-
fenceChar
private final char fenceChar
-
openingFenceLength
private final int openingFenceLength
-
firstLine
private java.lang.String firstLine
-
otherLines
private java.lang.StringBuilder otherLines
-
-
Method Detail
-
getBlock
public Block getBlock()
-
tryContinue
public BlockContinue tryContinue(ParserState state)
-
addLine
public void addLine(SourceLine line)
Description copied from interface:BlockParserAdd the part of a line that belongs to this block parser to parse (i.e. without any container block markers). Note that the line will only include aSourceLine.getSourceSpan()if source spans are enabled for inlines.- Specified by:
addLinein interfaceBlockParser- Overrides:
addLinein classAbstractBlockParser
-
closeBlock
public void closeBlock()
- Specified by:
closeBlockin interfaceBlockParser- Overrides:
closeBlockin classAbstractBlockParser
-
checkOpener
private static FencedCodeBlockParser checkOpener(java.lang.CharSequence line, int index, int indent)
-
tryClosing
private boolean tryClosing(java.lang.CharSequence line, int index)
-
-